- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- How to use public Property and Directory in script code?
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
How to use public Property and Directory in script code?
I inherited an InstallScript MSI Project. I do not have much knowledge in Installshield.
I created two Public Properties in Behavior and Logic/Property Manager: IS_UPGRADE_INSTALL value is 1
PSWEBSITENUMBER value is 0.
I also created two new Directories in Additional Tool/Direct Editor/Directory table:
PS_PF64_APOC_WORLD : path to folder A
PS_IIS_WEB: path to folder B
I would like to use these properties and directories in the OnBegin() event of the Script.
I put the following code in OnBegin(). but the syntax seems all wrong. I could not find good reference or example on how to use the Properties and Directories in code.
Would someone please help me to correct the syntax in these code:
function OnBegin()
BOOL bInstalled;
begin
MsiSetProperty(ISMSI_HANDLE, "IS_UPGRADE_INSTALL", "2"); // try to set 2 to IS_UPGRADE_INSTALL property
MessageBox("<IS_UPGRADE_INSTALL>", WARNING); //try to display the value of IS_UPGRADE_INSTALL
if ("<IS_UPGRADE_INSTALL>" = "2") then //try to check the value
MsiSetProperty(ISMSI_HANDLE, "PSWEBSITENUMBER", "3"); // try to set 3 to PSWEBSITENUMBER
FeatureSetTarget(MEDIA, "<PS_PF64_APOC_WORLD>", "<PS_IIS_WEB>"); //try to set the PS_IIS_WEB value to PS_PF64_APOC_WORLD so PS_PF64_APOC_WORLD will point to the folder of PS_IIS_WEB
endif;
MessageBox("<PS_PF64_APOC_WORLD>", WARNING); // try to display the directory
end;
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
See how to access the properties through scripts:
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Thank you for your help. The link shows me how to set /get a property, which is very useful. I also need to know how to use Directory in InstallScript.
Here is what I want to achieve. I created two Directories in the Directory table: MY_INSTALL_DIR1, MY_INSTALL_DIR2. I need to dynamically set the MY_INSTALL_DIR1 to be MY_INSTALL_DIR2. I cannot hard code the path for MY_INSTALL_DIR2 because this folder should be a sub folder under the "/Program Files" folder.
How can I dynamically set MY_INSTALL_DIR1 to be MY_INSTALL_DIR2?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @AceBear ,
See, whether you can change using "MsiSetTargetPath"
If it is not possible even you can edit the Directory table:
Other way if you want to set custom path to the component: