gpt4 book ai didi

windows-installer - cx_freeze bdist_msi : create registry entries?

转载 作者:行者123 更新时间:2023-12-01 19:45:35 24 4
gpt4 key购买 nike

我用了bdist_msi从过去的 cx_freeze 开始,它工作得很好。

现在我需要创建注册表项

是否可以使用 bdist_msi 创建注册表项?来自 cx_freeze?

使用 wixtools 这些设置是在过去完成的:

<!-- File extension .foostarter -->
<RegistryValue Root='HKCR' Type='string' Key='.foostarter' Value='foostarter.File' />
<RegistryValue Root='HKCR' Type='string' Key='.foostarter' Name='Content Type'
Value='application/vnd.foobar-modstarter' />
<RegistryValue Root='HKCR' Key='foostarter.File\Shell\Open' Type='string' Value='Ausfuehren' />
<RegistryValue Root='HKCR' Key='foostarter.File\Shell\Open\Command' Type='string'
Value='"[#foostarter.exe]" file "%%1"' />

<!-- protocol foostarter://... -->
<RegistryValue Root='HKCR' Key='foostarter' Type='string' Value='URL: foostarter Protocol' />
<RegistryValue Root='HKCR' Key='foostarter' Type='string' Name='URL Protocol' Value=''/>
<RegistryValue Root='HKCR' Key='foostarter\shell\open\command' Type='string'
Value='"[#foostarter.exe]" url "%%1"' />

<!-- start without asking -->
<RegistryValue Root='HKLM' Key='Software\Microsoft\Internet Explorer\ProtocolExecute\foostarter'
Name='WarnOnOpen' Value='0' Type='integer' />

最佳答案

我正在回答我自己的问题。我认为这个解决方案应该有效:

首先使用 bdist_msi 创建 msi 文件。

然后更改创建的 msi 文件。您可以使用 python 库 msilib.向表注册表添加一个条目,此处记录:https://docs.microsoft.com/en-us/windows/desktop/msi/registry-table

在 setup.py 中,我无法使用 cx_freeze 的未记录“数据”参数,因为它使用了 msilib.add_data() .并且此方法需要组件的外部 key 。

在 setup.py 期间我不知道这个组件 ID。

这就是为什么我认为您需要分两步执行此操作。

以上只是理论。在实践中,我使用 bdist_exe 然后 wix 来创建 msi。

由于以上只是模糊的猜测,非常欢迎反馈。

关于windows-installer - cx_freeze bdist_msi : create registry entries?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51656310/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com