让某个注册表值不被Installshied反安装
有些注册表的值在安装的时候写入目标机器,但是反安装的时候不希望反安装掉它,比如一些限制版的软件(限制使用时间)的时间参数,第一次使用时写入,以后每次安装都去查看对应的注册表值,反安装的时候不能反安装掉。
RegDBSetKeyValueEx的帮助中有下面这段话:
-
When they are created using RegDBCreateKeyEx.
-
While logging is enabled.
- When they are created automatically by InstallShield during the installation process.
- When they are created as a result of calling one of the special registry-related functions.
While logging is enabled.意思说只要把Logging禁止掉就可以实现反安装时候不反安装掉指定的注册表选项的功能。终于发现Disable(LOGGING); 可以禁用掉自动安装记录,赶紧在代码前,代码后加上了Disable(LOGGING); 和Enable(LOGGING); 果然,反安装时再也不会把注册表项删除了。当然如果我们需要的话,可以在反安装时添加代码修改注册表项。
3万+

被折叠的 条评论
为什么被折叠?



