Question

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.

Was it helpful?

Solution

Use the following to get SUPPORTDIR:

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

OTHER TIPS

Alright, I figured it out. Here's what happened, in case someone else runs into this issue:

First, I found my answer at http://social.technet.microsoft.com/Forums/windowsserver/en-US/01fc43a4-08b3-49c5-b265-60b819775194/temporary-directory-environment-variable-in-windows-server-2008?forum=windowsserver2008r2general

In case the link goes down, someone with the username triegler says:

"And upon further research, I found this:

http://technet.microsoft.com/en-us/library/cc755098.aspx

If you have temporary folders per session set up, that will cause this behavior. Turn that off, log off, log back on, and you should be saving directly to your root temp folder.

Tim"

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top