简体   繁体   中英

Registry based components with Inno Setup

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.

PS 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....

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;

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM