cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
AceBear
Level 4

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;

Labels (1)
0 Kudos
(3) Replies
banna_k
Revenera
Revenera

0 Kudos

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?

 

0 Kudos

0 Kudos