Brad Fitzpatrick (brad) wrote,
Brad Fitzpatrick
brad

Windows can blow me.

So, I'm redoing the Windows installation program for LiveJournal and the install system I'm using (NSIS) kicks ass, but it lacks a function to create new directories for certain types of things. The source to NSIS is open, so I was going to add it ... but it's an incredible mess, as Justin admits in the documentation.

However, NSIS has the ability to launch other programs and wait on them, so I thought--- no prob, I'll call "mkdir". Except you can't call shell built-ins. So I wrote a DOS batch file wrapper around mkdir ...

@echo off
if !%1==! goto skipit
if exist %1 goto skipit
mkdir %1
:skipit

But for some reason, it doesn't work on Win9x and the "if exist" line doesn't work, thus causing mkdir to generate an error and freeze the installation process with an ugly black command box showing. I'm not going to pretend I'm a expert batch file programmer, nor do I want to be. They're sick. So, I wrote a little Win32 C program to do it .... no more ugly DOS window during the installation:

#include "stdafx.h"
int APIENTRY WinMain
(HINSTANCE hInstance, HINSTANCE hPrevInstance,
 LPSTR lpCmdLine, int nCmdShow)
{ CreateDirectory(lpCmdLine, NULL); return 0; }
Both solutions suck. I mailed Justin and asked him to include the functionality.
Tags: blow me
Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 2 comments