Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8971975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:05:54+00:00 2026-06-15T18:05:54+00:00

I have created the following InnoSetup script for adding in optional components following advice

  • 0

I have created the following InnoSetup script for adding in optional components following advice from this StackOverflow answer: Inno Setup – Correct use of [Types], [Components] and [Tasks] .

The problem is when I run the script and choose to install or Sherlock or Toby types I see that Watson is also installed.

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Watson"
#define MyAppVersion "1.0"
#define MyAppExeName "Watson.exe"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{15C6F30B-A29D-48AD-A97A-9FDB4DD80EAE}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputDir=Z:\EGPL Librarian Releases\Setup Scripts\All Install
OutputBaseFilename=LibrarianSetup
Compression=lzma
SolidCompression=yes
WizardImageFile=compiler:WizModernImage-IS.bmp
WizardSmallImageFile=compiler:WizModernSmallImage-IS.bmp
VersionInfoVersion=1.0
VersionInfoCompany=Draper Laboratory
VersionInfoDescription=Watson Librarian Server
VersionInfoTextVersion=Watson 1.0
VersionInfoCopyright=2012
VersionInfoProductName=EGPL Librarian
VersionInfoProductVersion=1.0
VersionInfoProductTextVersion=Watson 1.0

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; Components: Watson Full

[Files]
Source: "Z:\EGPL Librarian Releases\Sample Installation\Watson\Watson.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: Watson Full
Source: "Z:\EGPL Librarian Releases\Sample Installation\Watson\Devart.Data.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: Watson Full
Source: "Z:\EGPL Librarian Releases\Sample Installation\Watson\Devart.Data.Linq.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: Watson Full
Source: "Z:\EGPL Librarian Releases\Sample Installation\Watson\Devart.Data.PostgreSql.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: Watson Full
Source: "Z:\EGPL Librarian Releases\Sample Installation\Watson\Devart.Data.PostgreSql.Linq.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: Watson Full
Source: "Z:\EGPL Librarian Releases\Sample Installation\Watson\Devart.Data.PostgreSql.xml"; DestDir: "{app}"; Flags: ignoreversion; Components: Watson Full
Source: "Z:\EGPL Librarian Releases\Sample Installation\Watson\Devart.Data.xml"; DestDir: "{app}"; Flags: ignoreversion; Components: Watson Full
Source: "Z:\EGPL Librarian Releases\Sample Installation\Watson\Ionic.Zip.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: Watson Full
Source: "Z:\EGPL Librarian Releases\Sample Installation\Watson\Watson.application"; DestDir: "{app}"; Flags: ignoreversion; Components: Watson Full
Source: "Z:\EGPL Librarian Releases\Sample Installation\Watson\Watson.exe.config"; DestDir: "{app}"; Flags: ignoreversion; Components: Watson Full
Source: "Z:\EGPL Librarian Releases\Sample Installation\Watson\Watson.exe.manifest"; DestDir: "{app}"; Flags: ignoreversion; Components: Watson Full
Source: "Z:\EGPL Librarian Releases\Sample Installation\Watson\Watson.pdb"; DestDir: "{app}"; Flags: ignoreversion; Components: Watson Full
; Toby
Source: "Z:\EGPL Librarian Releases\Sample Installation\wwwroot\Toby\*"; DestDir: "c:\\wwwroot\Toby"; Flags: ignoreversion createallsubdirs recursesubdirs; Components: Toby Full
; Sherlock
Source: "Z:\EGPL Librarian Releases\Sample Installation\wwwroot\Sherlock\*"; DestDir: "c:\\wwwroot\Sherlock"; Flags: ignoreversion createallsubdirs recursesubdirs; Components: Sherlock Full
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Components: Full Watson
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"; Components: Full Watson
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Components: Full Watson; Tasks: desktopicon

[Run]
Filename: "{app}\{#MyAppExeName}"; Flags: nowait postinstall skipifsilent; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Components: Watson Full

[Types]
Name: "Everything"; Description: "Install Watson, Sherlock, and Toby"
Name: "Watson"; Description: "Install Only Watson"
Name: "Toby"; Description: "Install Only Toby"
Name: "Sherlock"; Description: "Install Only Sherlock"

[Components]
Name: "Full"; Description: "Full Install"; Types: Watson Everything Toby Sherlock
Name: "Watson"; Description: "Watson Component"; Types: Watson
Name: "Toby"; Description: "Toby Component"; Types: Toby
Name: "Sherlock"; Description: "Sherlock Component"; Types: Sherlock

[Code]
function IsDotNetDetected(version: string; service: cardinal): boolean;
// Indicates whether the specified version and service pack of the .NET Framework is installed.
//
// version -- Specify one of these strings for the required .NET Framework version:
//    'v1.1.4322'     .NET Framework 1.1
//    'v2.0.50727'    .NET Framework 2.0
//    'v3.0'          .NET Framework 3.0
//    'v3.5'          .NET Framework 3.5
//    'v4\Client'     .NET Framework 4.0 Client Profile
//    'v4\Full'       .NET Framework 4.0 Full Installation
//    'v4.5'          .NET Framework 4.5
//
// service -- Specify any non-negative integer for the required service pack level:
//    0               No service packs required
//    1, 2, etc.      Service pack 1, 2, etc. required
var
    key: string;
    install, release, serviceCount: cardinal;
    check45, success: boolean;
begin
    // .NET 4.5 installs as update to .NET 4.0 Full
    if version = 'v4.5' then begin
        version := 'v4\Full';
        check45 := true;
    end else
        check45 := false;

    // installation key group for all .NET versions
    key := 'SOFTWARE\Microsoft\NET Framework Setup\NDP\' + version;

    // .NET 3.0 uses value InstallSuccess in subkey Setup
    if Pos('v3.0', version) = 1 then begin
        success := RegQueryDWordValue(HKLM, key + '\Setup', 'InstallSuccess', install);
    end else begin
        success := RegQueryDWordValue(HKLM, key, 'Install', install);
    end;

    // .NET 4.0/4.5 uses value Servicing instead of SP
    if Pos('v4', version) = 1 then begin
        success := success and RegQueryDWordValue(HKLM, key, 'Servicing', serviceCount);
    end else begin
        success := success and RegQueryDWordValue(HKLM, key, 'SP', serviceCount);
    end;

    // .NET 4.5 uses additional value Release
    if check45 then begin
        success := success and RegQueryDWordValue(HKLM, key, 'Release', release);
        success := success and (release >= 378389);
    end;

    result := success and (install = 1) and (serviceCount >= service);
end;


function InitializeSetup(): Boolean;
begin
    if not IsDotNetDetected('v4\Full', 0) then begin
        MsgBox('Watson requires Microsoft .NET Framework 4.0 Full Profile.'#13#13
            'Please run dotNetFx40_Full_x86_x64.exe from the install disk,' #13
            'or download from www.microsoft.com/net,'#13
            'and then re-run the WatsonSetup.exe program.', mbInformation, MB_OK);
        result := false;
    end else begin
//        MsgBox('Found Microsoft .NET Framework 4.0.', mbInformation, MB_OK);
        result := true;
    end;
end;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T18:05:55+00:00Added an answer on June 15, 2026 at 6:05 pm

    Link each file with just one component, and then link each component with the different types of installation where the component (with all it’s files) will be included.

    for example, defining this four install types:

    [Types]
    Name: "full"; Description: "Install Watson, Sherlock, and Toby"
    Name: "onlywatson"; Description: "Install Only Watson"
    Name: "onlytoby"; Description: "Install Only Toby"
    Name: "onlysherlock"; Description: "Install Only Sherlock"
    

    You can define just three components:

    [Components]
    Name: "watson"; Description: "Watson Component"; Types: onlywatson full
    Name: "toby"; Description: "Toby Component"; Types: onlytoby full
    Name: "sherlock"; Description: "Sherlock Component"; Types: onlysherlock full
    

    As you can see, each component is included in two types, one is the only X type of installation and the other is the full installation type.

    Then, define your files for one component each (unless you have good reasons to include a file with no components or in different ones, but that doesn’t make much sense to me).

    [Files]
    ;watson
    Source: "files\Watson.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: watson
    Source: "files\Watson.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: watson
    Source: "files\other.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: watson
    ; Toby
    Source: "files\toby\*"; DestDir: "{app}\extras\Toby"; Flags: ignoreversion createallsubdirs recursesubdirs; Components: toby
    ; Sherlock
    Source: "files\Sherlock\*"; DestDir: "{app}\extras\Sherlock"; Flags: ignoreversion createallsubdirs recursesubdirs; Components: sherlock
    

    The same reasoning applies to other sections, like [Icons], [Tasks] or [Run], where each entry usually belongs to just one component.

    I did a quick test for you, putting all this together:

    #define MyAppName "Watson"
    #define MyAppVersion "1.0"
    #define MyAppExeName "watson.txt"
    #define MyAppPublisher "Me.com"
    #define MyAppURL "Me.com"
    
    [Setup]
    AppId={{15C6F30B-A29D-48AD-A97A-9FDB4DD80EAE}
    AppName={#MyAppName}
    AppVersion={#MyAppVersion}
    AppPublisher={#MyAppPublisher}
    AppPublisherURL={#MyAppURL}
    AppSupportURL={#MyAppURL}
    AppUpdatesURL={#MyAppURL}
    DefaultDirName={pf}\{#MyAppName}
    DefaultGroupName={#MyAppName}
    OutputDir=Installer
    OutputBaseFilename=LibrarianSetup
    Compression=lzma
    SolidCompression=yes
    WizardImageFile=compiler:WizModernImage-IS.bmp
    WizardSmallImageFile=compiler:WizModernSmallImage-IS.bmp
    VersionInfoVersion=1.0
    VersionInfoCompany=Draper Laboratory
    VersionInfoDescription=Watson Librarian Server
    VersionInfoTextVersion=Watson 1.0
    VersionInfoCopyright=2012
    VersionInfoProductName=EGPL Librarian
    VersionInfoProductVersion=1.0
    VersionInfoProductTextVersion=Watson 1.0
    
    [Languages]
    Name: "english"; MessagesFile: "compiler:Default.isl"
    
    [Types]
    Name: "full"; Description: "Install Watson, Sherlock, and Toby"
    Name: "onlywatson"; Description: "Install Only Watson"
    Name: "onlytoby"; Description: "Install Only Toby"
    Name: "onlysherlock"; Description: "Install Only Sherlock"
    
    [Components]
    Name: "watson"; Description: "Watson Component"; Types: onlywatson full
    Name: "toby"; Description: "Toby Component"; Types: onlytoby full
    Name: "sherlock"; Description: "Sherlock Component"; Types: onlysherlock full
    
    [Files]
    ;watson
    Source: "files\Watson.txt"; DestDir: "{app}"; Flags: ignoreversion; Components: watson
    Source: "files\Watson1.txt"; DestDir: "{app}"; Flags: ignoreversion; Components: watson
    Source: "files\Watson2.txt"; DestDir: "{app}"; Flags: ignoreversion; Components: watson
    ; Toby
    Source: "files\toby\*"; DestDir: "{app}\extras\Toby"; Flags: ignoreversion createallsubdirs recursesubdirs; Components: toby
    ; Sherlock
    Source: "files\Sherlock\*"; DestDir: "{app}\extras\Sherlock"; Flags: ignoreversion createallsubdirs recursesubdirs; Components: sherlock
    ; NOTE: Don't use "Flags: ignoreversion" on any shared system files
    
    [Icons]
    Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Components: Watson
    Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"; Components: Watson
    Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Components: Watson; Tasks: desktopicon
    
    [Run]
    Filename: "{app}\{#MyAppExeName}"; Flags: nowait postinstall skipifsilent; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Components: Watson
    
    [Tasks]
    Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; Components: Watson
    

    It is tested with Inno 5.5.2 on my machine and works as you want.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created the following script that move old days files as defined from
I have created the following class implementing a ListSelectionListener interface. This class should listen
I have created the following Regular Expression in C# to extract tokens from a
I have created the following patch from the trunk: Index: Index.aspx =================================================================== --- Index.aspx
I'm using this technique to load data. So I have created the following resolve
I have the following in my Inno Setup file which creates a desktop icon
I have created the following javascript object dynamically (from PHP): var t_feed = '';
I have created the following code to show and hide divs. This shows one
I have created the following code http://jsfiddle.net/N65yS/41/ .. My problem is this.. When I
I have created the following TagBase and each category can have subcategory... Will this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.