PDA

View Full Version : How can I set a property to the source path?



flombardo
07-31-2002, 10:21 AM
I am trying to set a public property to the source path. I have tried the following and none seem to work:

MY_PROPERTY: [SOURCEDIR]MyFolder\MyApp.exe
MY_PROPERTY: [SRCDIR]MyFolder\MyApp.exe
MY_PROPERTY: SOURCEDIR\MyFolder\MyApp.exe
MY_PROPERTY: SRCDIR\MyFolder\MyApp.exe

I am working on a Basic MSI project. What am I doing wrong?

Thanks,
Frank

Joshua
07-31-2002, 10:30 AM
Frank,

What I've noticed in my experience is that properties cannot be assigned to properties. Therefore you cannot place [SourceDir] as the value of another property.

What I've found works is to create an InstallScript Custom Action that uses MsiGetProperty to retrieve the value of [SourceDir], then assigns that value using the MsiSetProperty function to the new property you create.

More info on these InstallScript functions can be found in the Help Library.

flombardo
07-31-2002, 11:18 AM
Originally posted by Joshua

What I've found works is to create an InstallScript Custom Action that uses MsiGetProperty to retrieve the value of [SourceDir], then assigns that value using the MsiSetProperty function to the new property you create.

Joshua,

I have used an InstallScript Custom Action to set MY_PROPERTY and it works. Adding the InstallScript Custom Action, causes another Custom Action to stop working.

I have a Custom Action (type 50) that launches the application specified by MY_PROPERTY. The Custom Action (type 50) works fine until I add an InstallScript Custom Action to the project. Even if the InstallScript Custom Action isn't called, the Custom Action (type 50) no longer runs. It doesn’t even show up in the log file.

I noticed that there are several InstallShield (“ISxxx”) Custom Actions that are inserted into the UI and execute sequences when I add the InstallScript Custom Action. I believe they are the cause of my problems. Am I doing something wrong?


Thanks,
Frank

flombardo
07-31-2002, 04:09 PM
I have found more details on what is going wrong. The following is an excerpt from the InstallShield help files:


Basic MSI Projects with InstallScript Custom Actions

In order for your InstallScript custom actions to function, these actions (from the list above) are automatically added to your project if you include an InstallScript custom action in your setup.

ISCleanUpFatalExit
ISCleanUpSuccess
ISCleanUpSuspend
ISCleanUpUserTerminate
ISMsiServerStartup
ISStartup


I have seen that the ISCleanUpSuccess action is added to the "Finish" button of the SetupCompleteSuccess dialog and it fails. I have a Custom Action (type 50) that is supposed to run on the "Finish" button as well. If I place my action before the ISCleanUpSuccess action, my action will run. If my action is placed after the ISCleanUpSuccess action, my action never runs. So, the question is, why is the ISCleanUpSuccess failing?