Loading
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

  • 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
    Expand Post
  • 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.
    Expand Post
  • 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...
  • 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.
    Expand Post

Loading
execute custum action only on uninstall