Creating System Restore Points - Thoughts?

房东的猫 提交于 2019-12-05 17:31:16

Is it "taboo" to programatically create system restore points?

No. That's why the API is there; so that you can have pseudo-atomic updates of the system.

Whether it's a good idea or not really depends on how much you're doing. A full system restore point is weighty - it takes time to create, disk space to store, and gets added to the interface of restore points, possibly pushing earlier restore points out of storage.

So, if your update is really only changing your application (i.e. the data it stores, the binaries that make it up, the registry entries for it), then it's not really a system level change, and I'd vote for no restore point. You can emulate the functionality by just backing up the parts you're changing, and offering a restore to backup option. My opinion is that System Restore should be to restore the system when global changes are made that might corrupt it (application install, etc).

The counter argument that one should just use the system service doesn't hold water for me; I worry that, if you have to issue a number of updates to your application, the set of system restore points might get so large that important, real "system wide" updates might get pushed out, or lost in the noise.

No, it's not Taboo - in fact, I'd encourage it. The OS manages how much hard drive takes, and I'd put money down on Microsoft spending more money & time testing System Restore than you the money & time you're putting into testing your setup application.

If you are developing an application for Vista you can use Transactional NTFS, which supports a similar feature to what you are looking for.

http://en.wikipedia.org/wiki/Transactional_NTFS

Wouldn't installer packages already include this type of rollback support, though? I'm not terribly familiar with most of them so I am not sure.

Finally, Windows will typically automatically create a restore point anytime you run a setup application.

Take a look at the following link: http://www.calumgrant.net/atomic/

The author described "Transactional Programming". This is analogous to the transactions in data bases.

Example:

Start transaction:

  1. Step 1
  2. Step 2
  3. Encounter error during step 2
  4. Roll back to before transaction started.

This is a new framework, but you can look at it more as a solution rather then using the framework.

By using transactions, you get the "Restore Points" that you're looking for.

I don't think a complete system restore would be a good plan. Two reasons that quickly come to mind:

  • Wasted disk space
  • Unintended consequences from a rollback
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!