使用卸载配置文件删除自定义属性表
我将信息存储在我的一个自定义产品的自定义属性表中(然后我在 JavaScript 文件中使用该信息)。我希望这个产品能够干净地卸载,但我似乎无法弄清楚如何使用 genericsetup 删除卸载时的自定义属性表。我知道 remove="True"
不起作用,但我没有太多运气找出删除它的正确方法(或任何与此相关的方法)。任何建议将不胜感激。
I'm storing information in a custom property sheet for one of my custom products (I'm then using that information in a javascript file). I want this product to uninstall cleanly, but I can't seem to figure out how to remove a custom property sheet on uninstall using genericsetup. I know that remove="True"
doesn't work, but I'm not having much luck figuring out the correct way (or any way for that matter) for removing this. Any suggestions would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这至少有两个原因令人困惑:
我们都有“旧式”和“新式”技术正在积极使用。旧样式指的是
Extensions/Install.py
(Python 代码),新样式指的是profiles/default
(GS XML + setuphandlers.py Python 代码)。在所有可能的情况下成功安装和卸载附加组件仍然需要使用新旧技术。
如果您不关心卸载,则永远不需要使用
Extensions/Install.py
。如果您确实关心卸载,请使用安装和卸载方法创建Extensions/Install.py
。还创建一个“卸载”配置文件(除了“默认”配置文件之外),例如
profiles/uninstall
。配置Extensions/Install.py:install()
方法来执行安装时的“正常”配置文件/默认步骤。现在到了“有趣”的部分。因为某些技术可以通过 GS“正确”卸载,即它们遵循
remove=True
参数,因此您的 Extensions/Install.py:uninstall() 方法应该执行“正确” " GS 配置文件进行卸载。但是,如果您的附加组件使用无法通过 GS“正确”卸载的技术,即那些不遵守remove=True
参数的技术,那么您将需要编写 Python 代码来执行卸载。请参阅:
了解更多信息。
This is confusing for at least two reasons:
We have both "old style" and "new style" technologies actively in use. Old style refers to
Extensions/Install.py
(Python code) and new style refers toprofiles/default
(GS XML + setuphandlers.py Python code).Successfully installing and uninstalling add-ons in all possible cases still requires the use of both old and new style technologies.
If you don't care about uninstall, you never need to use
Extensions/Install.py
. If you do care about uninstall, create anExtensions/Install.py
with install and uninstall methods.Also create an "uninstall" profile (in addition to the "default" profile) e.g.
profiles/uninstall
. Configure theExtensions/Install.py:install()
method to execute your "normal" profiles/default steps on installation. Now comes the "fun" part.Because some technologies can be uninstalled "properly" via GS i.e. they respect the
remove=True
parameter, your Extensions/Install.py:uninstall() method should execute the "proper" GS profiles to do the uninstall. But if your add-on uses technologies that cannot be uninstalled "properly" via GS i.e. those that do not respect theremove=True
parameter, then you will need to write Python code to perform the uninstall.See:
for more information.