Tuesday, June 21, 2011

Make Single Executable Installer using IExpress

Visual studio deployment project produce two file when built i.e: setup.exe and the .msi file. I need to make them into single-file executable installer. This reference is really useful. It turns out there's already a tool that exist in windows itself to combine several file installer into one : It is called IExpress.exe and reside on C:\Windows\System32.

I had some notes in following the above references (and it's various links) :

As the entry said, using setup.exe as an entry point does not work due to the "bug" introduced since visual studio 2008 (it was working in visual studio 2005).  I currently use visual studio 2010 and it still not working too. However, the given solution using batch file did not directly working either when I tried. When executed by resulting exe the .bat file seems to have trouble with long file name while it is working when I tested the .bat file directly.

Some trial and error later, it turns out that somehow the resulting .exe executed the .bat file using command.com and causing problems with file path. When I tested directly .bat, and working, it is executed by cmd.exe, that's why it behave differently. So in "Install Program to Launch" dialog, to ensure cmd.exe is used instead of command.com,  instead of entering setup.bat, I called the command  "cmd.exe /c setup.bat" as illustrated on the screenshot below.

Also, for the cleanups, instead of using the refered codeproject reference that relatively complex,  I used script that act as a pair of the setup.bat refered on the post and has content as below  :


and put it in Post Install Command field (using the same "cmd.exe /c" call as stated above). It is much simpler that way and utilize what's already provided by IExpress.

1 comment:

Anonymous said...
This comment has been removed by a blog administrator.