Thoughts about setup and deployment issues, WiX, XNA, the .NET Framework and Visual Studio
All postings are provided AS IS
with no warranties, and confer no rights. Additionally, views expressed
herein are my own and not those of my employer, Microsoft.
I have built an installer using the Visual Studio 2005 setup project wizard. It installs correctly on Windows XP but fails on Windows Vista. I investigated and found that the failure on Windows Vista is caused by a custom action that fails with an access denied error. However, I am running the setup with elevated privileges in Windows Vista. How can I fix my setup so it will work correctly on Windows Vista?
As Robert Flaming described in this blog post, it is necessary to set the NoImpersonate flag for custom actions that modify the system in Windows Vista. This was an uninforced architectural intent that is now enforced in Windows Vista.
Unfortunately, there is not a way to directly set this flag for a custom action in the UI for the setup project in the Visual Studio IDE. In Visual Studio 2005, you can use a post-build step that modifies the MSI to set this bit using a strategy previously described in this blog post.
You can use the following steps to set the NoImpersonate bit in a Visual Studio 2005 setup project:
<update date="1/22/2007"> Updated command line in step 7. The variable I had specified previously was incorrect. It actually needs to be spelled wrong using "ouput" instead of "output" in the $(BuiltOuputPath) variable </update>
<update date="3/18/2009"> Fixed broken link to the sample script. </update>
Recently, I was helping a customer investigate an issue in an MSI-based installer that they created for
A while back, I posted some instructions that can be used to run a post-build script to modify the custom
If you have an installer for a Windows application that uses a custom action step during the installation process, you will likely hit this error message when trying to run that installer on Windows Vista: "The installer has encountered an unexpected
There are a few Visual Studio 2005 bugs that surface when building installation packages on a Windows
Question: I am using the Visual Studio 2005 web setup project wizard to create an MSI-based installer
I have added the following command line in the Post-build event command line text box:
cscript.exe "$(ProjectDir)CustomAction_NoImpersonate.js" "$(BuiltOuputPath)"
When I build the MSI installer project it shows following error.
Error 1 'PreBuildEvent' failed with error code '1' 'Unspecified error'
What s the solution for this ?
Hi Shajipd - The steps listed in this blog post will run customaction_noimpersonate.js as a post-build step, but from your comments it sounds like a pre-build step is failing. Do you have any other commands listed in the Visual Studio pre-build steps? I would suggest starting by looking at those to try to narrow down this error further.
I've tried to connect to the link to get CustomAction_noimpersonate.zip but the web page fails to be delivered... help please.
Can you give an alternate site for this file?
Hi Qasper - I'm sorry, but my file server appears that it is down for maintenance for the holiday weekend. I don't have an alternative download location. If the site is not back up by the time I'm back at work on Tuesday, I will post the text of the script on my blog so you can copy and paste it and run it on your system.
I'm sorry for the hassle that this has caused you.
I am also trying to download the ZIP file CustomAction_noimpersonate.zip and unable to do so. If possible can you paste the file on bloag at earliest or give more hints so that I can write such script myself....
I previously posted a set of steps that can be used to toggle the NoImpersonate bit for custom actions