Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > USERPROFILE variable blank
 

USERPROFILE variable blank

Hello,

Icreated a bootstrapper from an MSI built in InstallShield 12. The bootstrapper is to be run by non-admin users and is supposed to install files under each user profile. In order to locate the path of a user profile I use an evironment variable [USERPROFILE] in InstallShield.

Here ismy problem: If I test-run the bootstrapper MSI directly from the local drive or a file share, the files are installed correctly into the user profile space. If I execute the bootstrapper by opening it in the IE, the files are installed in the C:. It seems as if the USERPROFILE variable is blank when the installation is started via the Internet Explorer.

Do you know how to identify a user profile path from the bootstrapper MSI?

Thank you,

Evgueni

Evgueni  Tuesday, June 05, 2007 8:10 PM

No, the setup.exe is built by the BMG. The MSI is build by InstallShield 12.I needed USERPROFILE environmental variable because when the prerequisites are installed by a non-admin user, the files cannot be placed anywhere but in a subfolder under the user's profile folder. I am not aware of any automatic redirection by MSI from Program Files to per-user folder under XP or earlier. Maybe, it's in available in Vista...

But anyways, the problem was actually with the InstallShield project. I will post the solution here since I am sure there are a lot of people building MSIs with InstallShield. The problem was that the custom action SetUserProfileNT was enabled for UI installation and disabled for Install Exec Sequence. Once I enabled the latter, the USERPROFILE variable got populated correctly. I guess when the bootstrapper Setup.exe calls the MSI, it goes into the Exec Sequence instead of UI sequence.

Thanks for your help.

Evgueni  Thursday, June 07, 2007 2:51 PM

Microsoft gurus -- where are you? Please help !!!

More information - if I run the bootstrapper MSI directly, from the file system or from IE, the files are installed correctly into the USERPROFILE space. If the bootstrapper installation is started via setup.exe, then the USERPROFILE property is empty and the files are placed in C.

Thanks.

Evgueni  Wednesday, June 06, 2007 7:35 PM

The bootstrapper is what people call the setup.exe program, and that fires off the MSI file. If I understand correctly, you're asking about the behavior of a setup.exe that is built by InstallShield 12, and I don't think many people in this forum can tell what InstallShield bootstrappers do. I'd ask in the InstallShield forums.

What are you doing with USERPROFILE? MSI installs are per-user or per-machine, and I don't understand why your setup.exe needs it, or even what it's using it for.

PhilWilson  Wednesday, June 06, 2007 8:47 PM

No, the setup.exe is built by the BMG. The MSI is build by InstallShield 12.I needed USERPROFILE environmental variable because when the prerequisites are installed by a non-admin user, the files cannot be placed anywhere but in a subfolder under the user's profile folder. I am not aware of any automatic redirection by MSI from Program Files to per-user folder under XP or earlier. Maybe, it's in available in Vista...

But anyways, the problem was actually with the InstallShield project. I will post the solution here since I am sure there are a lot of people building MSIs with InstallShield. The problem was that the custom action SetUserProfileNT was enabled for UI installation and disabled for Install Exec Sequence. Once I enabled the latter, the USERPROFILE variable got populated correctly. I guess when the bootstrapper Setup.exe calls the MSI, it goes into the Exec Sequence instead of UI sequence.

Thanks for your help.

Evgueni  Thursday, June 07, 2007 2:51 PM

You can use google to search for other answers

Custom Search

More Threads

• Just Me in older version and Every One in newer version
• How to make the installer leave the app.config file after uninstallation.?
• Cannot locate resource 'app.xaml', Click Once Install
• Invoking clickonce from within
• Updater block - downloading updates from a server
• Compiling ASP.NET Beta 2 for deployment
• Project deployment use case feasibility
• FileIO Exception Only On First Load of ClickOnce App
• Error: Unable to install . . requires stdole Version 7.0.33 be installed in GAC
• Using Makecert for signing and publishing a production app