cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
gridman
Level 8

Set properties during Maintenance Install

I have a Basic MSI and during the initial install, two components are installed based on the values of two different properties. If the respective property is set, then the component's files will be installed to a folder. This part is working fine.

But, during the maintenance install, I need to set these properties based on the presense of the files in this folder. Property1 will be set if the File1*.jpg are present in the folder, and the other Property2 will be set if the File2*.jpg are present in the folder. These two properties will in turn be used to set some checkboxes in a dialog that is displayed during the maintenance install UI sequence.

I have tried doing this with an InstallScript custom action, but it doesn't seem to be working. All I am doing is checking if the files are present, and if so, set the respective property. I am calling my custom action after the CostFinalize action in the UI Sequence.

Do you think I am going about this the right way?
Labels (1)
0 Kudos
(6) Replies
RobertDickau
Flexera Alumni

Offhand I don't see an obvious problem with this approach; perhaps you can post the action settings and a skeleton of the InstallScript code?
0 Kudos
charlieantao
Level 6

Can you also specify what is not working? Are the properties not getting set, or are the checkboxes not getting set?
0 Kudos
gridman
Level 8

I think I have found a problem.

I have two custom actions that are both InstallScript. So, each custom action has an InstallScript function that goes with it. Does each custom action have it's own Setup.rul file?

Right now, I have one Setup.rul file and both functions are in it. Let's call it Function1 and Function2. CustomAction1 uses Function1 and CustomAction2 is supposed to use Function2.

Now, when I click on CustomAction1, it refers to Function1. When I click on CustomAction2, it refers to Function1, yet I need it to refer to Function2. For some reason I can't change it to Function2.

As a result, I think the installer is getting confused by this.
0 Kudos
RobertDickau
Flexera Alumni

As a sanity check, what is the signature of Function2? The prototype should be something like:

export prototype Function2(HWND);

and the function definition should begin something like:

function Function2(hInstall)...
0 Kudos
gridman
Level 8

Yes Robert, I just checked and the prototype and function header of Function2 are as you specified.
0 Kudos
gridman
Level 8

I fixed this by deleting the CustomAction2 and recreating it. Then I was able to point it to Function2 without any problems.

Now, on to a different problem. Thanks for the help.
0 Kudos