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

SUPPORTDIR and UseDLL

Guys

In a basic MSI project, we have added a dll in the Support Files | Language Independent view. The call to UseDll from custom action/installscript fails.

UseDLL(SUPPORTDIR ^ "custom.dll");


In the MSI log, we see the following relevant entries

1: Getting SUPPORTDIR property :
1: Extracting SetupFiles to: C:\Users\USERNA~1\AppData\Local\Temp\{22B9BB8D-25F5-4CBA-89F7-E3F53AB7FB8C}

...

1: Extracting Setup File:
1: C:\Users\USERNA~1\AppData\Local\Temp\{22B9BB8D-25F5-4CBA-89F7-E3F53AB7FB8C}\custom.dll
1: Setting SUPPORTDIR property to:
MSI (c) (98!7C) [12:05:58:947]: PROPERTY CHANGE: Adding SUPPORTDIR property. Its value is 'C:\Users\USERNA~1\AppData\Local\Temp\{22B9BB8D-25F5-4CBA-89F7-E3F53AB7FB8C}'.

...

InstallShield 12:05:58: Extracting support file IsConfig.ini to C:\Users\USERNA~1\AppData\Local\Temp\{381302F9-C1C8-4517-AD7F-1BDEF8D4AEC8}\IsConfig.ini
InstallShield 12:05:59: Extracted isconfig.ini to C:\Users\USERNA~1\AppData\Local\Temp\{381302F9-C1C8-4517-AD7F-1BDEF8D4AEC8}\IsConfig.ini

...

InstallShield 12:06:00: Cleaning up temp file C:\Users\USERNA~1\AppData\Local\Temp\{381302F9-C1C8-4517-AD7F-1BDEF8D4AEC8}\IsConfig.ini



For debug purposes, we added the following to the script.

    MsiGetProperty(hMSI, "SUPPORTDIR", szSupportDir, nLength);
SprintfMsiLog ("Value of SUPPORTDIR is %s and that of szSupportDir is %s", SUPPORTDIR, szSupportDir);


Which gets printed in the log as
1: Value of SUPPORTDIR is C:\Users\USERNA~1\AppData\Local\Temp\{CE6D9031-8F1F-4960-9DCC-374C833574A4}\ and that of szSupportDir is


As you can see the dll got extracted to the folder {22B9BB8D-25F5-4CBA-89F7-E3F53AB7FB8C}, however the SUPPORTDIR is pointing to a different folder {CE6D9031-8F1F-4960-9DCC-374C833574A4}. It can also be seen that IsConfig.ini and some other files are getting extracted to this folder.

Any idea what could be going on.. Also note that trying to get the value of SUPPORTDIR using MsiGetProperty returns an empty string.

Looking forward to your response.

Sincerely
Praveen
Labels (1)
0 Kudos
(2) Replies
Reureu
Level 10

As you pointed out, the SUPPORTDIR variable and the SUPPORTDIR property are not the same.

If your DLL is added as Support file in your project, you need to access it with the SUPPORTDIR property.
If I remember well, this property is not accessible if your custom action is scheduled for deferred or commit execution, and it returns an empty value if you try to access it in such a custom action.

Consequently, you need to pass this property as Custom Action Data. See http://helpnet.installshield.com/installshield21helplib/helplibrary/AccessingProps-DeferredCAs.htm. This page refers to InstallShield 2014, but I'm pretty sure the procedure is the same with 2013.

You might also have to add SUPPORTDIR to the SecureCustomProperties property.

Good luck!

0 Kudos
firmusoft
Level 5

By passing in the SUPPORTDIR value as CustomActionData, was able to access it with in the script. Thanks for the lead....

Reureu wrote:
As you pointed out, the SUPPORTDIR variable and the SUPPORTDIR property are not the same.

If your DLL is added as Support file in your project, you need to access it with the SUPPORTDIR property.
If I remember well, this property is not accessible if your custom action is scheduled for deferred or commit execution, and it returns an empty value if you try to access it in such a custom action.

Consequently, you need to pass this property as Custom Action Data. See http://helpnet.installshield.com/installshield21helplib/helplibrary/AccessingProps-DeferredCAs.htm. This page refers to InstallShield 2014, but I'm pretty sure the procedure is the same with 2013.

Good luck!
0 Kudos