Jump to content

This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.

Issue when adding 2 Install paths

1 reply to this topic


  • Full Members
  • 187 posts

Posted 25 September 2012 - 00:52


I have a Basic MSI project in IS2010 which I intend to install both 32-bit and 64-bit dlls, assemblies, exes, etc. All my 32-bit stuff is going to Program Files(x86)... and all my 64-bit stuff is going to Program Files... Note this install is only for 64-bit OS's.

I modified the DestinationFolder Dialog to add an additional install path. The 32-bit path is the standard INSTALLDIR property. The 64-bit path is a custom INSTALLDIR64 property I made. I have tested all this and my files go where I select them to go with the changes I have made to this dialog. My issue is an edge case but perfectly possible. A user could select the same location for both the 32 and 64 bit files. In this instance I do not know what would happen but one bitness of files would overwrite the other resulting in a royal mess.

So I am looking for a way to write a custom action and have it fire either when a user clicks OK on the InstallChangeFolder dialog (the one that pops up when you hit browse to change the default path) or when you select next on the DestinationFolder Dialog.

How could I sequence this correctly so that I would be able to throw an error message and return the user to the dialog to correct the values?

I wrote a short script that does a MsiGetProperty on both of the values. In the Dialog Editor, I added a DoAction to the next button on the DestinationFolder dialog. The button fires a CA and I get two message boxes with the expected values (message boxes were in my script). My question is this...I am looking at both of the dialogs mentioned (DestinationFolder and InstallChangeFolder). Both have a condition on their respective Next or Ok buttons to spawn the next dialog (they are by default 1 or true) . If my CA triggered on the next/ok button, and I replaced the condition to move to the next dialog with a property that I populate with the result of my script, would that work? I do not know the order of execution for these events.

I know this sounds confusing so I attached a picture to help you follow what I say.

I basically just want to insert my own CA in between the default actions at the end of a dialog, return a value, and conditionally execute the default behavior or to do nothing.

Any thoughts?

Attached Images

  • Dialog_Editor.jpg


  • Full Members
  • 187 posts

Posted 26 September 2012 - 00:11

I believe I have a working solution to this problem...

A little recap.

The problem:
I have 2 concurrent install paths in a single MSI. Both of these paths are user editable. Therefor the possibility exists that a user can select the same path for both. This is bad for reasons stated above.

My intentions:
I would like to implement a message when the user clicks the next button to the DestinationFolder dialog which will warn the user of this error and either leave the user on the dialog or bring them back there.

My solution:
1. I created a public property called IS_PATHS_OK. (default value 0)

2. I wrote an installscript function which did a MsiGetProperty on both my paths. Then I compared them with StrCompare() and outputted a message box where appropriate. Depending on the results of the comparison, I set my custom public property to either 1 (if paths were different) or "" (if paths were the same). The key piece of information here is to set the value to NULL. I was setting the value to 0 and nothing worked correctly.

3. I wrote a CA that called the above function.

4. I added a DoAction event to the dialog's next button and sequenced it before the spawn next dialog event (NewDialog). The Do action called my CA mentioned above. Also, the condition of this event was 1 (always execute).

5. Lastly, I changed the condition of the NewDialog event that was already there to be my custom public property, IS_PATHS_OK. Making sure to sequence my DoAction before the NewDialog (higher in the list).

I will do some more testing but I think this works as it is. Does anyone have any further input.

And the string comparison by design is not case sensitive. The built in function I am using is stated in the help docs to not worry about the case. This takes care of users manually typing the path out rather then using the UI to select it.

Am I correct to set the property to NULL? Is there a better way to get the event condition to correctly handle Boolean values?