views:

44

answers:

1

alo Everyone.

My problem is twofold. I have a WiX Project that I have been working on, and have been tasked to make it perform a program execution regardless of the user pressing cancel, the installation being aborted (via an already existing version) or the user successfully finishing the installation.

I currently use the built-in diaglog system:

    <UIRef Id="WixUI_InstallDir" />

I currently have been very successful at executing the application after the install has finished. The difficulty has been in the fact the application is in the same location of the installer and I can't guarantee where that will be. Therefore I used the following method to execute the program after the install has been successful:

<InstallExecuteSequence>
  <Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>
  <RemoveExistingProducts After="InstallInitialize" />
  <Custom Action="PropertyAssign"  Before="InstallFinalize">NOT Installed</Custom>
  <Custom Action="LaunchFile" After="InstallFinalize">NOT Installed</Custom>
</InstallExecuteSequence>


    <CustomAction Id='PropertyAssign' Property='PathProperty' Value='[SourceDir][DRIVEREXEC]' />
    <CustomAction Id="LaunchFile" Property="PathProperty" ExeCommand='/S' Return="asyncNoWait" />

The two custom actions are used to execute the application after the install has finished. Because of this I can't assign two custom actions when the program exists. OnExit="error" throws an exception when two custom actions have the same setting.

How does one execute an application, location unknown -- but assumed to be in the same directory of the installer -- unconditionally?

I thank you all for your time and kind replies

+1  A: 

You might check out the WiX documentation about how to run an application after setup: http://wix.sourceforge.net/manual-wix3/run_program_after_install.htm. That will give you pointers into the WiX UI dialog set that you could tweak if necessary.

Also, SourceDir is a very tricky thing to use: http://robmensching.com/blog/posts/2010/1/26/StackOverflow-what-does-NameSourceDir-refer-to. Ideally you'd launch the application installed instead of from media.

Rob Mensching
Rob, thank you for your reply. I am in the unfortunate position that I need to work with one or many executables that 'may' come packaged with the media. In the event they are, I have to run them. To combat this I used the SourceDir upon completion, along with a parameter to set where I am. My endgame was in the event of cancellation, abort, etc -- still have the executables fire. Your advice mentions how to have the checkbox appear in any situation (abort -- etc) but it doesn't tell me how to tell the installer where it's at. I'm sorry I'm rather new at this and I may have missed it.
Hewlett123
I'm not following this part of your question, "but it doesn't tell me how to tell the installer where it's at". Can you clarify.
Rob Mensching
Sorry about the delay, I do appreciate all the help and time you're spending with me. To some extent I need the installer to be self-aware (regarding it's location). The installer needs to know where it is at on disk. This is why I'm using SourceDir. (The installer is saying) I know I am located in c:\temp\install, now execute installer2 from c:\temp\install. On the other hand, if someone moves the installer, say to c:\place, I'd like the installer to then turn and try and execute installer2 from c:\place.
Hewlett123