Page 1 of 1

Getting an action to run with NEEDSUPGRADE

Posted: Wed Nov 12, 2008 2:01 pm
by BWCDawg
I am brand new to using InstallAware, I just installed the evaluation version yesterday. I am using a .NET setup project. One of the requirements of my installation is to run an executable to install a printer from a 3rd party. I have this working correctly for install, and it runs the executable with a different command-line for uninstall correctly as well.

What I cant get to work is having it remove the printer during an upgrade. I think the upgrade logic is working because I see a message about removing files when using the installer after having installed a previous version, but my executable isn't running. I put the entries in the Pre-requisites section on line 27 of the .NET template and also tried around line 47 of the same template. I know the "Run Program" statements are correct because I cut/paste them from the uninstall section, but they never execute. Any ideas?

Edit: I enabled every dialog box and now when I launch one of the "Requirements" is showing as "Remove Previous Installation". When I click past it I think it is removing it because my desktop shortcut id deleted. My custom executable is never run though.

Some solution...

Posted: Thu Nov 13, 2008 4:06 pm
by BWCDawg
I've continued to work on the problem and have an interim solution that raises another question.

The reason the actions would not run is in the MSIcode the $TARGETDIR$ and COMMONFILES properties are not set until after the section of code that handles the upgrade. I moved them up and it is running now.

The question that raises is this.. If I want to run a custom action from the installed directory during an upgrade, how do I know what the $TARGETDIR$ is? I know what it is if I remove the dialog box that allowed the user to change it.. but lets assume that during the first install the user installed to a different directory than the default. Is there a variable that represents the previous installations directory?