Search code examples
windows-installerinstallshieldinstallscriptinstallscript-msi

installshield 2012 SUPPORTDIR


I have an Installshield Installscript MSI installer that I have to maintain. It contains about 10 text files in Support Files/Billboards. When the installer runs, I open the files for editing/copying in a custom Installscript function using the following code:

OpenFile(nvReadFileHandle, SUPPORTDIR, LOGGER_PRM)

This code has worked perfectly for probably a thousand installs, many of which have been this exact version of the installer. Then, yesterday, it failed for the first time.

After looking in the msi log, I see the file being extracted to:

%TEMP%\3\ {GUID1}\ <-- ignore the space

When the above code executes, the value of SUPPORTDIR is:

%TEMP%\ {GUID2}\ <-- ignore the space

This has never failed before. So why is it happening now? What can I do to fix it? I see conflicting information when I google the problem. I'd rather not do trial and error 50 times to get a solution considering the circumstances.

edit: Here's some more information. I just found out that the server where we are installing is a clone of a virtual machine. I suspect that the environment variables used are incorrect. If we type "cd %temp%", it will go to the first directory above. However, if I look at the environment variables named TEMP, they all refer to the second directory above.


Solution

  • Use the following to get SUPPORTDIR:

    nvBuffSize = MAX_SIZE;
    MsiGetProperty( hMSI, "SUPPORTDIR", svSUPPORTDIR, nvBuffSize);