This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- CustomActionData to Access a Property
Subscribe
- 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
Aug 20, 2008
02:56 AM
CustomActionData to Access a Property
I tried the below code written in example
To access SUPPORTDIR through a deferred InstallScript custom action
In the Custom Actions and Sequences view, create a set-a-property custom action (type 51) called GetSUPPORTDIR . Configure the Property Name, Property Value, and Install Exec Sequence settings for the custom action as follows, and leave all of the other settings blank.
Property Name: DisplaySupportDir
Property Value: [SUPPORTDIR]
Install Exec Sequence: After InstallInitialize
In the InstallScript view, create a new function called DisplaySupportDir.
Add the following code to display a message box containing the value of SUPPORTDIR:
function DisplaySupportDir(hMSI)
STRING supportDirPath;
NUMBER supportDirPathBuffer;
begin
supportDirPathBuffer = MAX_PATH;
if(MsiGetProperty(hMSI, "CustomActionData", supportDirPath, supportDirPathBuffer) == ERROR_SUCCESS) then
SprintfBox(INFORMATION,"Deferred Execution","The value of SUPPORTDIR is %s",supportDirPath);
SprintfBox(INFORMATION,"Deferred Execution","The value of InstallScript's SUPPORTDIR is %s",SUPPORTDIR);
endif;
end;
In the Custom Actions and Sequences view, create an InstallScript custom action called DisplaySupportDir. Configure the Function Name, In-Script Execution, and Install Exec Sequence settings for the custom action as follows, and leave all of the other settings blank.
Function Name: DisplaySupportDir
In-Script Execution: Deferred Execution in System Context
Install Exec Sequence: After GetSUPPORTDIR
When I execute the installer the first SprintfBox (supportDirPath variable) gives blank and second SprintfBox gives correct supportdir value. Is that the required behaviour.
When I am printing SUPPORTDIR directly , it is giving me the correct path.
Is this correct behaviour?
To access SUPPORTDIR through a deferred InstallScript custom action
In the Custom Actions and Sequences view, create a set-a-property custom action (type 51) called GetSUPPORTDIR . Configure the Property Name, Property Value, and Install Exec Sequence settings for the custom action as follows, and leave all of the other settings blank.
Property Name: DisplaySupportDir
Property Value: [SUPPORTDIR]
Install Exec Sequence: After InstallInitialize
In the InstallScript view, create a new function called DisplaySupportDir.
Add the following code to display a message box containing the value of SUPPORTDIR:
function DisplaySupportDir(hMSI)
STRING supportDirPath;
NUMBER supportDirPathBuffer;
begin
supportDirPathBuffer = MAX_PATH;
if(MsiGetProperty(hMSI, "CustomActionData", supportDirPath, supportDirPathBuffer) == ERROR_SUCCESS) then
SprintfBox(INFORMATION,"Deferred Execution","The value of SUPPORTDIR is %s",supportDirPath);
SprintfBox(INFORMATION,"Deferred Execution","The value of InstallScript's SUPPORTDIR is %s",SUPPORTDIR);
endif;
end;
In the Custom Actions and Sequences view, create an InstallScript custom action called DisplaySupportDir. Configure the Function Name, In-Script Execution, and Install Exec Sequence settings for the custom action as follows, and leave all of the other settings blank.
Function Name: DisplaySupportDir
In-Script Execution: Deferred Execution in System Context
Install Exec Sequence: After GetSUPPORTDIR
When I execute the installer the first SprintfBox (supportDirPath variable) gives blank and second SprintfBox gives correct supportdir value. Is that the required behaviour.
When I am printing SUPPORTDIR directly , it is giving me the correct path.
Is this correct behaviour?
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Aug 20, 2008
07:44 AM
You might want to check out the sample @
http://www.installsite.org/pages/en/msi/ca.htm
(first sample)
http://www.installsite.org/pages/en/msi/ca.htm
(first sample)