开发者

how to handle temporary files/folders of VS setup project?

Still learning create MSI installer with VS 2008 for our C# application. We have some batch files to create database and tables,开发者_开发问答 after installation we want to delete it because there are sensitive information on them (username, password, ...). My questions are like those:

  1. where should I put those temporary folders/files? (doesn't matter?)
  2. how to delete them after installation? or how to call batch file from installer? I was able to add a custome action to modify app.config file but call batch file should be a different way. (simpler than having a installer class?)
  3. how to guarantee those files will be deleted even something wrong during the installation?

thanks,


Instead of a batch file, which anyone can open and read, consider compiling the sensitive information and commands into an .exe. If you store information in a file on someone's PC, you cannot guarantee they will not copy and retain it.

Ideally, temporary folders and files get installed in the windows temp directory, but you can also install them in your application directory.

You can't guarantee the install will complete or files will get deleted, but you can do the delete (or whatever) as early as possible so they can't install without that deletion, or you can have your app or some other process complete the deletion after the install.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜