cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
aclayto87
Level 5

Set Registry through Prerequisite?

Hi,
I was wondering if there is a way to set registry values through the prerequisite Component Wizard. i am building a MSI install, and i am needing to change the registry values before all of the Prerequisites install, and i am not seeing a way to do this through the custom actions. It seems that the custom actions essentially begin executing AFTER the prerequisites are done. (if i am wrong, please let me know where i should be putting my custom action in order for it to execute before the prerequisites are done).

Please let me know if there is a way to make a prerequisite set registry values... im not sure how else to do this since they must be set essentially when the install starts... thanks!
Labels (1)
0 Kudos
(4) Replies
DebbieL
Level 17

Right, setup prerequisites are launched before the main installation begins (and hence before any custom actions are launched). Feature prerequisites are launched if/when the features that contain the prerequisites are installed. For more info about the differences between these two types of InstallShield prerequisites, see Setup Prerequisites vs. Feature Prerequisites

Can you create a simple installation that makes the required registry changes, create an InstallShield prerequisite for that installation, and then add it to your project as the first prerequisite to be run?
0 Kudos
aclayto87
Level 5

I was able to make a .reg file and was able to change the registry by making that a prerequisite. So that part is done. thanks for clarifying alot of things!

So now i am working on some finishing touches..
I am getting some warnings from the custom actions i created. The warnings are "The Custom Action in the InstallExecuteSequence table is run from an installed file. To run the custom action successfully, you may need to have a condition that checks if the source file is installed locally."

So the custom actions work fine, and i do see where i could be setting a condition in the Custom action under "Install Exec Condition", i just have never quite gotten the hang of conditions, though i have tried many times.

what would be the syntax to check if the file has already been installed? and to run the custom action if it has been installed?

thanks for all the help!
0 Kudos
DebbieL
Level 17

If you are sure that the action will be run only when the file is present, you can ignore the warning. If it is possible that the action may be launched when the file is not present (for example, if the file is in a feature that end users can choose to not install), you'll want to add some sort of condition to the custom action.

You may want to add a condition that checks the action of the feature or the component that contains the file. Thus, if you want the action to run only when feature has been installed (and not during uninstallation for example), try a custom action condition such as this:
&MyFeature=3
or
&MyFeature>=3
(depending on whether the feature can be installed locally or allowed to be run from source)

You'll want to test your installation and uninstallation with the custom action condition and make sure it behaves as needed.

Here are a few links with more info:
http://msdn.microsoft.com/en-us/library/aa368012(VS.85).aspx
http://msdn.microsoft.com/en-us/library/aa368561(VS.85).aspx

I hope that helps.
0 Kudos
aclayto87
Level 5

thank you.. i finally got a condition to work properly.. what a relief.. even though i was not getting errors on the install (only warnings) because i was not setting a condition for the custom action i was unable to uninstall it! So i was able to set a condition that only executed the custom actions to install if the components were scheduled to install:

$componentName.exe=3

thanks again for all the help! On my way to finally getting my first MSI install complete!
0 Kudos