开发者

Best practices for deploying data to a custom folder

开发者 https://www.devze.com 2023-02-11 21:23 出处:网络
Sometimes when we issue an upgrade to our application we need to install some files to the application\'s Data folder. We want to make it possible for the users to move this folder to a place of their

Sometimes when we issue an upgrade to our application we need to install some files to the application's Data folder. We want to make it possible for the users to move this folder to a place of their liking. But how to deal wit开发者_开发技巧h this at install time? I was thinking of deploying to the user's AppData folder and have the application somehow check there for new files at startup.

Any advice or references would be very welcome!

We use InnoSetup for a VB6 application if that matters for your answer.


Generally the best solution I've found is to allow the user to move the folder from within the application.

This allows the application to keep track of where its data is being kept (by adding a reference to it in a file or registry entry which it accesses at load time) and to access it seamlessly in the future.

Your update routines can then also access this information to determine where to place the update files.

Alternatively, make sure the folder name is as distinctive as possible and add a search routine to look for the directory in a number of sensible places at load time. Then write your manual specifying that the data folder can be moved to one of those locations ONLY.


Wouldn't the users just run an update or patch package? I'm not sure why they'd want or need to see such files. It's pretty rare for commercial software to offer users the options of where to store program settings and other internal-use files.

Give some thought to this before putting a lot of stuff into users' roaming profiles. You might want LocalAppData instead.

0

精彩评论

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

关注公众号