cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
LKM_N4EN
Level 6

SUPPORTDIR path not consistent

My setup need to use some some files from SUPPORTDIR only during installation and uninstallation. I understand that I can put the files in "Support Files" in basic msi project and use the "SUPPORTDIR" in installscript.

I created two custom action for installation and installation respectively. However, the call to those files failed and from the log, I can see that it is because the path to SUPPORTDIR wrong when running my installscript.
I checked that those files are actually put in userTempfolder\{ProductCode}, but when running the installscript the SUPPORTDIR point to another code.

Both custom actions are placed after InstallInitialize and using "Deferred execution in system context". If anybody know where is my mistake, please point out.
Thanks!
Labels (1)
0 Kudos
(4) Replies
DebbieL
Level 17

Deferred custom actions do not have access to most Windows Installer properties. The following help topic explains how you can make the value of SUPPORTDIR available to a deferred custom action:
Accessing or Setting Windows Installer Properties Through Deferred, Commit, and Rollback Custom Actions
0 Kudos
LKM_N4EN
Level 6

I have read through the help topic and tried it before I post my question. Apparently it does not help me to solve my issue. During installation, I noticed two folder were created in user TempFolder. The first folder always consistent and named with {ProductCode}, and also all the files i put in support files is here. The second folder name always dynamic, and it contains files like "_isres.dll, IsConfig.ini, ISRT.dll, setup.inx ..."

1. Usually the SUPPORTDIR should be the temp folder named with the {ProductCode}? If yes, i would rather point to "TempFolder\{ProductCode} to access my files for installation and uninstallation.

2. Refer to the link you give, i put the following in my function:
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;
The result of first message box is empty!!! Why it is so?
0 Kudos
DebbieL
Level 17

What is the name of your deferred custom action? It must match the name of the property that you create with your immediate set-a-property custom action. (That is, if you're looking at the procedure in the help topic that I referenced earlier in this thread, the property name in step 1 must match the name of the custom action that you create in step 4.)
0 Kudos
LKM_N4EN
Level 6

Yes, It works now. I was thinking the MSIGetProperty should use the property name we set in first step.

In this case, I will need to have several SetProperty custom action with different property name for different custom action to access the SUPPORTDIR.
0 Kudos