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

Reply via email to