Video Screencast Help
Search Video Help Close Back
to help
New in the Rewards Catalog: Vouchers for "Symantec Technical Specialist" and "Symantec Certified Specialist" exams.

How to run Exe located in same folder as MSI

Updated: 02 Jun 2010 | 4 comments
berlin's picture
0 0 Votes
Login to vote

Hello out there,

is it just me or is it really a difficulty: Wise Installation Express 7.0. I want my MSI-Setup to run an Exe which is located in the same folder as the MSI.
How do I get this path? I had no luck with [SourceDir] or [OriginalDatabase] :-(

Background: I have a 600MB-Zip-File, which needs to be extracted after the setup has installed other things. I converted the Zip to a self-extracting Exe and just have to run it. I don't want to use "Execute Program From Installation", as this adds the Zip into my MSI and blows blows up my wsi to 650MB, which makes working with it very bulky and hard to manage. The MSI and the self-extracting Zip will be deployed on CD.
So I'm looking for a command to make my setup run the self-extracting Zip (Exe) which is located in the same drive/folder as the MSI itself, namely on a CD.

Regards from Munich!

discussion Filed Under:

Comments

philbenson's picture
20
Nov
2009
0 Votes 0
Login to vote

You should be

able to get the SourceDir / OriginalDatabase providing you have added the ResolveSource function to your script. I take it you are trying to execute the executable in the ExecuteDeferred seq.? If so you will have to take extra steps to access a Property that (for example) contains the SourceDirectory of your executable...

Just my tuppence

Cheers
Phil

EdT's picture
23
Nov
2009
0 Votes 0
Login to vote

The [OriginalDatabase]

The [OriginalDatabase] property should be the one that reports where the MSI was started from.
You can check what value this property contains by looking in a verbose installation log - have you done this?
However, as Phil has pointed out, during the deferred sequence, property values, with very limited exceptions, are not available. For this reason, windows installer provides the CustomActionData property which can be used to make specific property values available during the deferred sequence.

What you could think about, perhaps, is whether you have to wait for the deferred sequence to install your ZIP content - could it not be done first without loss of functionality? If so, then putting these files down during the immediate sequence would avoid having to code the CustomActionData stuff.

I assume you have a cleanup custom action to delete this ZIP content on uninstall?

Finally, Phil mentioned the ResolveSource custom action. As far as I'm aware, this only affects the SourceDir property, by making it available sooner in the install sequence. However, you need to make sure that a condition of "NOT Installed" is used with the ResolveSource action, otherwise you will get problems on uninstall.

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

berlin's picture
01
Dec
2009
0 Votes 0
Login to vote

Starting Exe from MSI-setup still not working :-(

thank you EdT and Phil for your help. Due to illness I could not test your suggestions until today. I'm afraid I still need some more assistance ...

Using a verbose installation log it seems that [OriginalDatabase] points to Drive:\some\folder\MySetup.msi. So the SourceDir property, pointing to Drive:\some\folder\ seems to be more suitable for my needs.
However, I did not succeed in running my exe (self-extracting zip) from my setup. This is what I tried:
In Execute Immediate I inserted a Set Property action with a new Property name (MyExeProperty) and a value of
[SourceDir]MyZip.exe
The next action is Execute Program From Path with property MyExeProperty.
When the Set Property action is executed, I get an error "Skipping action due to msidbCustomActionTypeClientRepeat option" in verbose log and an errorlevel 1631 from my Execute Program From Path  action.

I also tried to define my property (MyExeProperty) directly in Setup Editor Properties with same value as above.

Any help how I have to set my properties to run my self-extracting zip.exe from setup is appreciated!

Regards

EdT's picture
01
Dec
2009
0 Votes 0
Login to vote

Are you testing on a clean build?

Error 1631 means:  The Windows Installer service failed to start. Contact your support personnel.
So on the face of it, it looks like there may be a problem with your test system. You should always test on a clean build - either use a VM or have a ghost or wim image of your test system that you can restore to the partition quickly.

I also wonder what attributes you have set on your custom action.

msidbCustomActionTypeClientRepeat

Hexadecimal: 0x00000300

Decimal: 768

Execute only if running on client after UI sequence has run. The action runs only if the execute sequence is run on the client following UI sequence. May be used to provide either/or logic, or to suppress the UI-related processing if already done for the client session.

Are you running a silent install with no UI ?

Personally, I would always use the [OriginalDatabase] property if I need to know where the MSI was originally launched from. It is trivial to parse the value to remove the filename and thus generate the path to the source.

Finally, it helps us to help you if you can supply precise information on where in a sequence you have placed a custom action. Just stating in the "Immediate sequence" is really not good enough - we need to know where amongst the other actions you have placed yours.
Since you have chosen fo use SourceDir, have you sequenced your action at a point where SourceDir has a valid value? Did you need to use the ResolveSource action that Phil mentioned?

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.