4

I created Visual Studio 2005 Setup project for my application. Windows Installer during installation put one xml file into AppData/myCustomFolder. I used File System Editor and added special folder - user's app data folder, then included that xml there.

When I uninstall application from Control Panel folder from Program Files is deleted, but also my xml file from AppData is deleted too. I need to leave this xml file in the AppData always, even when user re-install application.

How I could do it?

Akim Khalilov
  • 1,019
  • 4
  • 16
  • 31

1 Answers1

5

Set the Permanent property to True

Permanent Property

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
  • I checked the solution. You are right, this property could leave file during uninstall process. But if you set property to true once and then return back to false you'll see that it's not working. File wouldn't be uninstalled never. This is bug of windows installer. I mean if you set one file to permanent=true, and then set another file to permanent=true, but unset first one, both of them are permanent now regardless of which option was chosen. You should rename files to reset windows installer behavior. – Akim Khalilov Jan 20 '11 at 07:37
  • @AkimKhalilov, Is there a way around this problem? I accidentally set the Permanent flag on one of my files and now the uninstaller never deletes the file even though I've reset Permanent to False. There's gotta be something in the registry, right? – bsh152s Feb 16 '17 at 20:27
  • If the `visual studio installer project` does not delete files, and you have previously enabled and disabled the `Permanent` setting, then your installer has ordered your operating system to store some files forever. If you are making the installer global, look for this entry in the registry here `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components` – KUL Sep 24 '21 at 00:22
  • @KUL fwiw Microsoft doesn't support that. Do it at your own risk. – Christopher Painter Sep 24 '21 at 03:17