If your wrapper doesn't have to be MSI, I would recommend iexpress. It can be scripted in a build environment, it supports compressing/extracting any number of files (as a single group) and calling any arbitrary executable with arbitrary parameters (which I don't believe are configurable at runtime). And, it comes "built-in" on all recent versions of Windows.
There is basically no documentation I have discovered for it, but if you run iexpress.exe it allows you to generate a SED file. Once you have created that file (it is an INI-style text file, so it can be included in your source control and can be maintained with any text editor) you build using the following command-line: iexpress /N /Q <SED-filename> It creates a self-extract EXE that contains all of your files in one package, and when run extracts everything to a folder in your %TEMP% directory and runs what you tell it (usually one of the files you extracted, such as your setup.exe). It doesn't put anything into ARP and it removes the folder for you when the setup.exe you specify exits. The biggest problems I have had with it are 1) it doesn't (as of the last time I used it) report errors in a build-server-friendly way (via the exit code); 2) I never found a way to suppress the extraction dialog (but it goes away as soon as the files are extracted, it isn't modal); and 3) there is virtually no documentation on the SED file format. To start, run iexpress from a command-line and build a SED file using the wizard. -----Original Message----- From: Mateusz Bronk [mailto:bron...@gmail.com] Sent: Saturday, August 29, 2009 3:20 AM To: wix-users@lists.sourceforge.net Subject: [WiX-users] MSI wrapper for .exe setup Hi All, I have an executable setup.exe with a bunch of files accompanying it. What I need to do, is to embed it into a single package (I don't have sources for the other setup project, so I can't simply rebuild that installer into one package). Basically what I need, is a self-extracting archive that launches "setup.exe" after extraction and cleans after itself (I'm aware that my approach violates a bunch of good practices, but single-file installer is a must-have for me). For now I'm using an .msi built from a Setup Project in Visual Studio'08: I simply added custom actions for install and uninstall which launch setup.exe with appropriate switches. The problem is - now, upon installing, I have 2 entries in "Add/Remove programs", another folder with setup files that are no longer needed, etc. That's why I'd like to customize my .msi a little to make it a simple wrapper - not exactly a full installer. What I expect of this installer is to: 1) Extract underlying setup.exe (and other needed files) to a temporary location (show only a progressbar while extracting, or no GUI at all) 2) Run setup.exe with the command line parameters as provided to wrapping MSI 3) Leave no trace in the system (that is: do not create an entry in Add/Remove Programs, remove temporary installation dir and so on. Note that none of extracted files would be ever needed, as embedded setup will install to user-selected location and have its own uninstall routines. In simple words: I'd like the app to cleanly "uninstall" itself right after installing (only custom action result shall persist). I've switched to WIX Toolkit, since AFAIK creating such a setup with MS VStudio Setup Project is not possible. What I already have is an GUI-less installer that extracts its content files to temp dir and launches setup.exe as a custom action. Questions I have: 1. How to pass multiple commandline switches to setup.exe? 2. How to delete destination directory upon execution of setup.exe?. I tried a VBS script (as below) - It's not willing to work ;) 3. What to do to remove any trace (despite custom action result - as above) of install on setup exit? Thanks in advance, Mateusz ---------------------------------------------------------------------------- --------- Outline ot the wix file I have so far (I've ommited some not relevant elements and attributes): <?xml version="1.0" encoding="utf-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Product> <Package InstallerVersion="200" Compressed="yes" /> <Media Id="1" Cabinet="MyInstaller.cab" EmbedCab="yes" /> <Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="TempFolder"> <Directory Id='INSTALLLOCATION' Name='MyInstaller'> <!--COMPONENTS HERE--> </Directory> </Directory> </Directory> <Feature Id="ProductFeature" Level="1"> <!--COMPONENT REFS HERE--> </Feature> <CustomAction Id="LaunchSetup" FileKey="setup.exe" ExeCommand="[SETUPPARAMS]" Execute="immediate" Return="ignore" HideTarget="no" Impersonate="yes" /> <Binary Id='RemoveUnpackDir.vbs' SourceFile='RemoveUnpackDir.vbs' /> <CustomAction Id="RemoveUnpackDir" BinaryKey="RemoveUnpackDir.vbs" VBScriptCall="RemoveUnpackDir" Return="check"/> <InstallExecuteSequence> <Custom Action='LaunchSetup' After='InstallFiles'></Custom> <Custom Action='RemoveUnpackDir' After='LaunchSetup'></Custom> </InstallExecuteSequence> </Product> </Wix> ---------------------------------------------------------------------------- --------- VBS script to delete target dir (not working :)) 'RemoveUnpackDir.vbs scriptFunction RemoveUnpackDir() RemoveUnpackDir = 3 Set oFSO = CreateObject("Scripting.FileSystemObject") oFSO.GetFolder(Session.Property("INSTALLLOCATION")).Delete(True) RemoveUnpackDir = 1 'return success End Function ---------------------------------------------------------------------------- -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users