开发者

How to make a "Typical" and "Custom" installation option in Inno Setup?

开发者 https://www.devze.com 2023-02-01 03:39 出处:网络
I\'ve seen a lot of software give users an option to install software with the typical settings, or to allow the users to开发者_开发百科 choose what settings they prefer (like whether they want a desk

I've seen a lot of software give users an option to install software with the typical settings, or to allow the users to开发者_开发百科 choose what settings they prefer (like whether they want a desktop icon or not). How can I do this with Inno Setup?


There's a sample of doing just this with the Inno Setup install. See the Inno Setup 5\Examples\Components.iss file that comes with Inno Setup itself.

The example shows creating "Full", "Compact", and "Custom" installation options in a single Setup.exe file.

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

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

[Setup]
AppName=My Program
AppVersion=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
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"


I think you should use the [Code] Section

The answer given by Ken White only works with Files to include/exclude from the installation.

It does not disable the dir page or the page that asks the user, if he wants or not the desktop icon. (for example)

Check out the example : CodeClasses.iss within C:\Program Files\Inno Setup 5\Examples

0

精彩评论

暂无评论...
验证码 换一张
取 消