使用 Inno Setup 的基于注册表的组件

发布于 2024-09-03 04:14:24 字数 336 浏览 2 评论 0原文

我正在为我的公司创建一个应用程序。目标是创建一个通用安装程序,它将检查用户注册表中是否安装了特定应用程序,并根据这些应用程序在“选择组件”窗口中创建可用安装组件列表。这就是我遇到的特殊问题。

我已经创建了安装程序,但用户必须选中/取消选中他不需要的组件,因为他不使用特定的应用程序。我想这绝对不是一个好方法……

所以我请求帮助。这可以通过“选择组件”窗口来实现吗?或者我应该如何创建带有复选框的自定义向导页面(再次 - 如何)?

提前致谢。

PS 我已经在我的脚本中使用了 Check 功能,但在这种情况下,程序会自动安装与用户计算机上找到的应用程序相关的所有组件,有时用户不需要......

I'm creating an application for my company. And the goal is to create a universal installer that will be checking user's registry for specific apps installed and according to these apps would create a list of available installation components in "Select Components" window. And that's the particular problem I'm stacked with.

I've already created the installer, but a user have to check/uncheck components he doesn't need because he doesn't use specific app. That is definitely not a good way of doing thing I guess...

So I'm asking for help, please. Could this be implemented through "Select Components" window and how or I should create custom wizard page with checkboxes (again - How)?

Many thx in advance.

P.S. I've already used Check function in my script, but in this case the program automatically installs all of the components related to found apps on users machine, and sometimes users don't need that....

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

活雷疯 2024-09-10 04:14:24

这将根据注册表值删除组件。您想要修改它以适合您尝试安装的每个应用程序,并且可能需要为每个应用程序提供一个检查功能。

    ; -- Components.iss --
    ; Demonstrates a components-based installation.

    ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING .ISS SCRIPT FILES!

    [Setup]
    AppName=My Program
    AppVerName=My Program version 1.5
    DefaultDirName={pf}\My Program
    DefaultGroupName=My Program
    UninstallDisplayIcon={app}\MyProg.exe
    OutputDir=userdocs:Inno Setup Examples Output

    [Types]
    Name: "full"; Description: "Full installation"
    Name: "compact"; Description: "Compact installation"
    Name: "custom"; Description: "Custom installation"; Flags: iscustom

    [Components]
    Name: "program"; Description: "Program Files"; Types: full compact custom; Flags: fixed
    Name: "help"; Description: "Help File"; Types: full; Check: IsMyAppInstalled
    Name: "readme"; Description: "Readme File"; Types: full
    Name: "readme\en"; Description: "English"; Flags: exclusive
    Name: "readme\de"; Description: "German"; Flags: exclusive

    [Files]
    Source: "MyProg.exe"; DestDir: "{app}"; Components: program
    Source: "MyProg.chm"; DestDir: "{app}"; Components: help
    Source: "Readme.txt"; DestDir: "{app}"; Components: readme\en; Flags: isreadme
    Source: "Readme-German.txt"; DestName: "Liesmich.txt"; DestDir: "{app}"; Components: readme\de; Flags: isreadme

    [Icons]
    Name: "{group}\My Program"; Filename: "{app}\MyProg.exe"

    [Code]
    function IsMyAppInstalled(): Boolean;
    Var
      installed: String;

    begin
      if RegQueryStringValue(HKEY_CURRENT_USER, 'Software\MyApp',
         'Installed', installed) then
        result := true
      Else
        result := false;
    end;

This removes a component based on a registry value. You'd want to modify this to fit each application you are trying to install and would probably need a Check function for each application.

    ; -- Components.iss --
    ; Demonstrates a components-based installation.

    ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING .ISS SCRIPT FILES!

    [Setup]
    AppName=My Program
    AppVerName=My Program version 1.5
    DefaultDirName={pf}\My Program
    DefaultGroupName=My Program
    UninstallDisplayIcon={app}\MyProg.exe
    OutputDir=userdocs:Inno Setup Examples Output

    [Types]
    Name: "full"; Description: "Full installation"
    Name: "compact"; Description: "Compact installation"
    Name: "custom"; Description: "Custom installation"; Flags: iscustom

    [Components]
    Name: "program"; Description: "Program Files"; Types: full compact custom; Flags: fixed
    Name: "help"; Description: "Help File"; Types: full; Check: IsMyAppInstalled
    Name: "readme"; Description: "Readme File"; Types: full
    Name: "readme\en"; Description: "English"; Flags: exclusive
    Name: "readme\de"; Description: "German"; Flags: exclusive

    [Files]
    Source: "MyProg.exe"; DestDir: "{app}"; Components: program
    Source: "MyProg.chm"; DestDir: "{app}"; Components: help
    Source: "Readme.txt"; DestDir: "{app}"; Components: readme\en; Flags: isreadme
    Source: "Readme-German.txt"; DestName: "Liesmich.txt"; DestDir: "{app}"; Components: readme\de; Flags: isreadme

    [Icons]
    Name: "{group}\My Program"; Filename: "{app}\MyProg.exe"

    [Code]
    function IsMyAppInstalled(): Boolean;
    Var
      installed: String;

    begin
      if RegQueryStringValue(HKEY_CURRENT_USER, 'Software\MyApp',
         'Installed', installed) then
        result := true
      Else
        result := false;
    end;
万劫不复 2024-09-10 04:14:24

你想做的超出了 Inno Setup 的设计范围,我认为你需要编写自己的安装程序,而不是使用 Inno Setup 等通用安装程序框架。

What you want to do goes beyond Inno Setup design, and I think you need to write your own installer instead of using a generic installer framework such as Inno Setup.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文