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

Installer trying to modify mdf file


8 replies to this topic

Amarjeet

Amarjeet
  • Full Members
  • 77 posts

Posted 22 March 2010 - 07:40

I have created an msi which installs SQL 2005 mdf and ldf files in below folder.

c:\program Files\Common Files\TestApplication\Test.mdf
c:\program Files\Common Files\TestApplication\Test.ldf

Installation goes well. I am able to attach databases as well as work on this database.

I created a patch for this product. This patch does not involve modifying database files as both mdf and ldf files are marked permanent during first msi install. When i try to un install the patch it gives error.

error 1321 : Installer has not sufficient permissions to modfify files c:\Fprogram Files\Common Files\TestApplication\Test.mdf.

If i install the product inintially with no database files, patch installation and uninstallation is successful.

Why installer is trying to modify files marked as permanent? This problem is observed only on Vista with UAC ON. With UAC off everything works well.

Thanks in advance

Amarjeet

Edited by Amarjeet, 22 March 2010 - 08:40.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 22 March 2010 - 09:57

Permanent only means that the file will not be deleted on uninstall. You may also need set the never overwrite flag.

Amarjeet

Amarjeet
  • Full Members
  • 77 posts

Posted 22 March 2010 - 10:04

I have set "never overwrite" for this file. There are several text and other files in c:\program files\common files. I don't get error for them. These files are set to never overwrite and permanent.

If i install these database files in some other folder say c:\test i did not get error.

Please refer attached screenshot for details.

Attached Images

  • SQL_component_settings.jpg


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 22 March 2010 - 10:15

Maybe the error message is misleading. Maybe it doesn't really need to modify these files, but it checks if it *could* if needed, and fails if it detects that it can't.

In general you shouldn't place data files in the program files directory.

Amarjeet

Amarjeet
  • Full Members
  • 77 posts

Posted 23 March 2010 - 08:39

We have included this path for installing database files, as with windows vista logo certification its no longer allows data to be written on c: drive. Alternately you can suggest suitable directory for us.

I tried to uninstall software with logging options and found error code below.

Action start 11:43:44: InstallValidate.
MSI (s) (C4:F0) [11:43:44:515]: Note: 1: 2205 2: 3: _RemoveFilePath
MSI (s) (C4:F0) [11:43:47:650]: Note: 1: 1321 2: C:\Program Files\Common Files\Test\Test_Data.MDF
MSI (s) (C4:F0) [11:43:47:660]: Product: Flowmaster V7.7.0 -- Error 1321.The Installer has insufficient privileges to modify the file C:\Program Files\Common Files\Test\Test_Data.MDF.

Error 1321.The Installer has insufficient privileges to modify the file C:\Program Files\Common Files\Test\Test_Data.MDF.

Is there any way i can bypass this RemoveFilepath during patch uninstallation. Alteranately can i modify directory table to get fix.

Thanks

AMarjeet

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 23 March 2010 - 12:59

Maybe %ALLUSERSPROFILE% could be used as an alternative.

You could modify the permission for the database folder to allow write access, but this isn't recommended.

Amarjeet

Amarjeet
  • Full Members
  • 77 posts

Posted 23 March 2010 - 13:05

Just now tried to change permissions to Full, as well as changed owner to local admin user. But still gettting error. My product has 4 features. While patching i am only patching one of the features. SQL files are in the feature not getting patches.

So my question is even if i am not patching the feature, why installer give this error. I can't find documentation of this error on internet.

If i turn off UAC uninstallation is successful.

Do you have any idea, how to set admin privilege during uninstallation of patch. While installing i am able to do it with manifest file. But it seems that during uninstallation installer does not take care how uninstallation was done, with whom permissions.

Amarjeet

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 03 May 2010 - 12:25

You can specify the permissions in the Files and Folder view of InstallShield. This needs to be done during install.

vPanchumarthi

vPanchumarthi
  • Full Members
  • 56 posts

Posted 12 May 2010 - 13:04

Hi,

You can use cacls.exe to specifiy permissions via installation. But this is okay for normal folder but not good to give permisisons to programfiles folder while installation. As you specified like reducing UAC will resolve the problem, then your application will not be a VISTA CERTIFIED.
It would be fine if you copy mdf and ldf files to %ALLUSERS% folder as suggested by stefan.