Inno 设置和 DefaultDirName
是否有某种方法可以根据用户在安装时所做的某些决定通过代码设置 DefaultDirName?
我来评论一下: 我有一些为两个不同系统构建的代码(使用不同的互操作/ocx 等)。我的输入文件存储在两个目录 input\A 和 input\B 中。 我只想为两个系统提供一个安装文件。
在安装文件中,我使用 CreateInputOptionPage 和 2 个选项来确定要安装哪些文件(对每个文件使用“检查”)。这工作正常。
但我在安装完成时也有一些 ShellExec,目前它使用 {app} 来注册一些 .Net 类,并使用 ShellExec 在 InitializeUninstall 上取消注册 .Net 类(也使用 {app})。
安装程序必须安装该软件位于两个不同的位置(取决于用户的选择(例如 c:\software_a 或 c:\software_b)。无法更改这一点。
那么在将文件复制到系统之前是否有某种方法可以指定 DefaultDirName,所以我可以在安装和卸载时使用相同的 ShellExec 吗?我当然可以在安装时为两个系统添加相同的 ShellExec 并使用 if 来检查要注册的文件(取决于用户选择),但在卸载时我不会有这个信息(用户选择),所以我无法取消注册 .Net 类,
谢谢。
Is there some way to set the DefaultDirName by code depending on some decission a user did on installtion?
Let me comment:
I have some code which is build for two different systems (using different interops/ocx's and such stuff). My input files are stored in two directories input\A and input\B.
I want to have only one setup-file for both systems.
In the setup file i use CreateInputOptionPage with 2 options to determin which files to install (using Check on each file). This works okay.
But i do also have some ShellExec on finish of setup, which at the moment uses {app} to e.g. register some .Net classes and ShellExec to unregister the .Net classes on InitializeUninstall (also uses {app})
The setup must install the software on two different locations (depending on the selection of the user (eg. c:\software_a or c:\software_b). Can't change this.
So is there some way to specify the DefaultDirName before the files get copied to the system, so i can use the same ShellExec on install and uninstall? I could of course add the same ShellExec for both systems on installtation and use an if to check which files to register (depending on the user selection) but on uninstall i would not have this information (user selection), so i can not unregister the .Net classes.
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 CreateInputOptionPage 代码部分中,您可以设置一个值,然后在下面的代码片段中使用该值。我还没有测试过,但它可能有效。
In your CreateInputOptionPage code section, you might be able to set a value then use that value in the code snippet below. I haven't tested it but it might work.
如果您需要在初始化 DefaultDirName 后更改安装文件夹,这对我来说非常有效:
干杯
克里斯
If you need to change the install folder after the DefaultDirName has been initialized, this was working for me quite well:
Cheers
Chris