开发者

MSI uninstallation not to remove all the folders

开发者 https://www.devze.com 2023-02-07 10:12 出处:网络
On uninstallation, the installer removes the installed folder and all its subdirectories. However, we want to retain some log files regarding the uni开发者_开发百科nstallation. How do I make the insta

On uninstallation, the installer removes the installed folder and all its subdirectories. However, we want to retain some log files regarding the uni开发者_开发百科nstallation. How do I make the installer not remove the installed folder?


My recommendation would be for the log files to be stored under a folder in %APPDATA%, that is created when required by the application, rather than the installer. As the folder would not be created by the installer, this would resolve the problem of the installer removing it.

It's also worth mentioning that if the installer is creating a folder under %PROGRAMFILES% for your application and you're keeping the log files there, you're doing the wrong thing, as it's not the correct place to store log data because:

  • %PROGRAMFILES% is not writable for standard users
  • %APPDATA% is the "correct" place to store things such as logs (it's all in the name! =)


Have you written files to the folder at this point, or just assuming the directory will be deleted since you see it being deleted today (without an new files in it). From my experience, the MSI will not remove a folder that is not empty. So the MSI will remove its own files, but the log files will be in there, thus it will not remove the directory.

I agree with @Rob though, this is most likely not the best location to be writing the log files.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号