views:

249

answers:

4

I have a very simple Setup project that copies three dlls into the GAC. That's all it has to do. It works fine in XP, but on a Vista machine, it errors out stating that it cannot write to the file and to check permissions. I'm sure this has to do with some impersonation nonsense in Vista, but I'm not sure how to address it.

Has anyone else encountered this, and how did you overcome it if so?

+1  A: 

You use the gacutil.exe to install the dlls? Or do you just copy the files?

Anyway, GAC should be avoided for custom dlls unless they're used by many applications. Keep the dlls close/local to the application: it will only cost you some diskspace, and it enables you to use simple Xcopy deployment.

Frans Bouma
Thanks for the reply, but you can spare me the lecture on using the GAC. I'm aware of when and when not to use it. In this case, I need to utilize the GAC. That's why I asked the question and created an installer for automating the process.
Kilhoffer
Sorry, but even the MS guidelines tell you this. Anyway, downmodding me (whoever it was) isn't going to solve the problem for you, is it?. Didn't I ask a question, which you didn't answer? i.o.w.: do you use gacutil.exe ?
Frans Bouma
For the record, I didnt down-vote you. To answer your question, no, I did not use gacutil directly. The MSI installer does that for you. I'm talking about building an installer that simply GACs three assemblies for you.
Kilhoffer
I gave up the MSI installer for an InstallShield installer instead.It works perfectly, but I still don't know why I ran into those issues with the MSI on Vista.
Kilhoffer
If you used MSI from the vs.net installer package: that one indeed sucks. I always use NSIS, as it's free and very fast/simple. About the GAC: there's no reason why any 3rd party should be in the gac, not even policy files, that's why I mentioned it.
Frans Bouma
Thanks for the tip on NSIS. I'm going to move away from doing installer packages from VS.
Kilhoffer
@Frans Bouma never worked with BizTalk, have you?
RobS
@Rob: no, I never had the displeasure to work with that ;)
Frans Bouma
+1  A: 

If you're using Windows Installer, are you putting your assemblies into the special Global Assembly Cache folder? That has always worked for me on Vista and Windows 7. There is no need to use GACUtil or anything else, just put the assemblies in the right folder in the installer project.

Tim Long
A: 

I have had some (3rd party) MSI's which won't install correctly unless I force elevated mode from the start, even if they show a UAC prompt later in the process.

Troubleshooting... I assume you are installing from an administrator account. But, is UAC enabled? If it is, are you getting the UAC elevation prompt? Try running the MSI package in elevated mode to see if it works. From an elevated command prompt:

msiexec /i setup.msi
Lucas
A: 

What compiler are you using to make the MSI's? After last weekends fun I may be an expert at MSI vs. Vista issues :)

If using VC2003 or VC2005 there are different issues depending on the compiler version.

If 2005, be sure to have installed the service pack and the Vista service pack. That may solve your problem.

If that fails, you can put them in the GAC with a custom action, but beware there is a bug in 2005 where the no_impersonate bit is incorrectly set. You will have to set this bit yourself using either a script or orca.exe.

Jeremy White