Community Forums
Results 1 to 3 of 3

Thread: SUPPORTDIR and UseDLL

  1. #1
    Join Date
    Jan 2010
    Posts
    40

    Question 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.

    Code:
    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.

    Code:
        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

  2. #2
    Join Date
    Feb 2009
    Location
    Switzerland
    Posts
    304

    Smile What about the Custom Action Data

    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/ins...eferredCAs.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!

  3. #3
    Join Date
    Jan 2010
    Posts
    40

    CustomActionData

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

    Quote Originally Posted by Reureu View Post
    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/ins...eferredCAs.htm. This page refers to InstallShield 2014, but I'm pretty sure the procedure is the same with 2013.

    Good luck!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •