cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
saimen
Level 4

execute custum action only on uninstall

I have to launch a exe with parameter -s when the pachage installs and with parameter -u when i'm uninstalling the msi.
i made to custom action but i don't know which condition number to set. the -s condion works but the -u gives me a error because the exe is already deleted.

i hope i could explain the problem, because my english is not better...

thanx a lot
Labels (1)
0 Kudos
(8) Replies
thepeter
Level 7

tell us a bit more:
- what kind of project is it?
- what do you need to accomplish with the custom action?
- when do you sequence it?
0 Kudos
saimen
Level 4

it's a simple msi project. i copy a folder with some files to c:\program files\directory. in a subdirectory i have some dll and a install exe. during the installation a launch the install.exe (installs a virtual printer) with my custom action.the install_printer custom action is sequenced as 6505, before install finalize. it works perfectly but my problem is the uninstallation.
i would like to delete the printer when i uninstall my pachage. to do this i have to launch the install.exe with the parameter -u and i don't know when i have to launch the custom action
0 Kudos
thepeter
Level 7

I see. If you use "Path referencing a directory" as your EXE type custom action you will need two custom actions for this:
- one that you call during Install (set condition NOT Installed) with the -s parameter before "After InstallFinalize"
- one that you call during Uninstall (set condition REMOVE="ALL") with the -u parameter anywhere between "After InstallValidate" and "After RemoveFiles"

There are a few ways to Install a virtual printer through scripts - just google for it. If you still want to use your "install exe" method I would recommend using the "Stored in Binary table" custom action type. In this way you don't have to install the "install exe" file with your MSI.
0 Kudos
saimen
Level 4

thanks for your help. I tried to do how you explained me but the printer doesn't install anymore.

i attach two scrennshots, maybe they can help to understand...
0 Kudos
thepeter
Level 7

It's "NOT Installed" with a capital I as a condition. Have you logged your installation?
also your custom action types are wrong - they should both be "Path referencing a directory"
I strongly recommend doing some more learning on Custom Actions. Even the build-in help is good.
0 Kudos
saimen
Level 4

thank you very much for your help!!!
it works perfectly!
0 Kudos
thepeter
Level 7

You really need to check out this document: "MSI Sequences and Standard Actions: An Introduction"
Robert Dickau has a very good way of explaining things...

best of luck.
0 Kudos
saimen
Level 4

ok i will read it
thanks again
0 Kudos