Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

1321 problem on uninstall


3 replies to this topic

spdygnlz

spdygnlz
  • Full Members
  • 106 posts

Posted 07 August 2007 - 21:14

I'm running into a problem where it seems that the uninstaller doesn't have the required permissions to remove a couple files. I'm putting them into the MS SQL Data directory in the install. The permissions on that folder only differ from a normal folder in that it doesn't give any permissions to the "Users" group. It gives Full Control to "Administrators" group and "SYSTEM" group, just like most normal folders do.

Here's a copy of the message I get in the log.
CODE
01383: (Unknown): Info 1321.The Installer has insufficient privileges to modify the file C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\MyDatabase.mdf.

I have already looked at this thread, http://forum.install...showtopic=15361, but it doesn't seem to apply because I'm not tweaking any permissions on the file or folder at all. Most searches that I do on Google have to do with problems installing, not uninstalling. My install puts the files in the folder just fine. What's going on?

Thanks!

-- spdygnlz --

spdygnlz

spdygnlz
  • Full Members
  • 106 posts

Posted 08 August 2007 - 00:16

Update:

Seems as if the permissions on the files themselves are getting changed. The source files give Full Control to "Administrators", "SYSTEM", some SQL Server 2005 built in user, and my domain user account. After a successful install, the "SYSTEM" user is stripped out. After I try to uninstall, all but my user account are stripped. That explains why it can't remove it, but why is it changing?

By the way, I'm just testing this install on my development machine for now... Don't know what happens with my domain user account if it's installed on another machine.

-- spdygnlz --

VBScab

VBScab
  • Full Members
  • 436 posts

Posted 06 September 2007 - 15:05

I think the permissions is a red herring. I suspect that the file is open while SQL Server is running. try stopping the SQL Server service before uninstalling.
- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.

spdygnlz

spdygnlz
  • Full Members
  • 106 posts

Posted 06 September 2007 - 16:57

So I finally figured out what the deal was. I feel kinda silly.

What was happening was that I was using Microsoft's SMO to attach and detach the database. I wasn't aware of this, but by doing that, the SMO itself was changing permissions on the files. http://msdn2.microso...y/ms189128.aspx (By the way, I really had a hard time finding that help page. It wasn't on the AttachDatabase function documentation like I thought it should be.)

So that still left me with the problem that when I detach the database, it gives full permissions to me (the user running the install) and removes everyone else. Doing that made it so the uninstall couldn't remove the file. Easy solution: Make the Custom Action Deferred Execution in the System Context. That made the SMO change the permissions to Local System which is apparently the user that tries to remove files on the uninstall.

I chalk this whole thing up to inexperience on my part (and lousy documentation), but then again, that's really the reason for most everyone's posts, right?

-- spdygnlz --