Registry based components with Inno Setup - 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.
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....

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;

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.

Related

Inno Setup - titles my setup as "My Setup", how to change this?

Here is my code: As you see I have given the name of my application, but still I get the title "My Setup" when I run it
[Setup]
AppName=Diabetis
AppVersion=0.9
DefaultDirName={pf}\Diabetis
DefaultGroupName=Diabetis
UninstallDisplayIcon={app}\Diabetis.exe
Compression=lzma2
SolidCompression=yes
OutputDir="C:\Users\nwsco\source\repos\Diabetis_sqllite\"
[Dirs]
Name: {app}; Permissions: users-full //to allow manipulating database
[Files]
Source: "C:\Users\nwsco\source\repos\Diabetis_sqllite\Diabetis\bin\Debug\Diabetis.exe"; DestDir: "{app}"
Source: "C:\Users\nwsco\source\repos\Diabetis_sqllite\Diabetis\bin\Debug\Diabetis.db"; DestDir: "{app}"
Source: "C:\Users\nwsco\source\repos\Diabetis_sqllite\Diabetis\bin\Debug\DSettings.db"; DestDir: "{app}"
Source: "C:\Users\nwsco\source\repos\Diabetis_sqllite\Diabetis\bin\Debug\Diabetis.pdb";
[Icons]
Name: "{group}\Diabetis"; Filename: "{app}\Diabetis.exe"
I solved my problem by adding:
OutputBaseFilename=Diabetis_Setup.exe
but now I have another problem, the program will display Diabetis_Setup.exe.exe, writing therefore twice the .exe.
I have tried also:
OutputBaseFilename=Diabetis_Setup
but it does not like it

Custom Disk Spanning in Inno Setup

Is there any way Components section based custom disk spanning?
For example:
[Components]
Name: "c1"; Description: "Component 1"
Name: "sc2"; Description: "Special Component 2"
Name: "redist"; Description: "Redistributables"
[Files]
Source: component.exe; DestDir: "{app}"; Components: c1
Source: "specialfolder\*"; DestDir: "{app}"; Components: sc2
Source: redist.msi; DestDir: "{app}"; Components: redist
The files that i want to see after compile: setup.exe, c1.bin, special.bin, redist.bin
Thanks.
No it is not possible.
If your intention was to allow user to get only the pieces he/she needs, you can use the extern flag and {src} source directory instead. Though this is not really disk spanning. But it would allow the user to have just the files needed for the installation along the setup.exe. If you really need to store the files on separate disks, you can implement a prompt for additional disks and an actual installation in Pascal script.

Windows Registry Location Error Chrome Extension

im trying to figure out how to install a extension as a installer via Windows Registry. Google only allows extensions to be installed from the web store, or Windows Registry. I've been bangin my head with this for the last few days. Ok I have the correct key/values for the Registry. But for some reason when I run the Inno installer, the extension does not get installed.
1)Google Dev Tutorial says: The data type is a string and the windows registry location is as such:
Software\Policies\Chromium\ExtensionInstallForcelist
2) Google Dev Tutorial also gives an example such as:
Software\Policies\Chromium\ExtensionInstallForcelist\1 = "lcncmkcnkcdbbanbjakcencbaoegdjlp;https://clients2.google.com/service/update2/crx"
Below is a snippet of my registry. (Below is a link that gives instructions for force installations, which is what I'm, trying to do
http://dev.chromium.org/administrators/policy-list-3#ExtensionInstallForcelist)
[Registry]
Root: HKLM; Subkey: "Software\Policies\Chromium\ExtensionInstallForcelist";
ValueType: string; ValueName: "FavMovie"; ValueData: "igcijckafdbfnikpopgapfedkceligpn;https://clients2.google.com/service/update2/crx"
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: " {cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "C:\Program Files (x86)\Inno Setup 5\Examples\MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\Chrome Extension"; Filename: "{app}\MyProg.exe"
Name: "{commondesktop}\Chrome Extension"; Filename: "{app}\MyProg.exe"; Tasks: desktopicon
[Run]
Filename: "{app}\MyProg.exe"; Description: "{cm:LaunchProgram,Chrome Extension}"; Flags: nowait postinstall skipifsilent
From the document you quote:
Note: Starting with Chromium 28, policies are loaded directly from the Group Policy API on Windows. Policies manually written to the registry will be ignored.
See also the respective Chromium Blog announcement.
You can still trigger an install through the registry if the extension is published on CWS, or if your computer is part of a domain and you control the group policy on that domain.

Two choices for separate added folders

I am trying to extract content via Inno Setup, however I would like the user to pick between two options, each a different "folder" to extract somewhere. How do I go about doing this? I'm not even sure where to start on InnoSetup help.
[Files]
Source: "C:\Users\jorda_000\x64"; DestDir: "{appdata}\Roaming\.mhks"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\Users\jorda_000\x32"; DestDir: "{appdata}\Roaming\.mhks"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
This is what I have in the script for files after adding them. Basically, they pick either 64-Bit or 32-Bit and it updates files in the program folder folder.
Nevermind. I didn't fully understand the "Components" section of Inno Setup.
Added.
[Components]
Name: "main"; Description: "64-bit"; Types: full compact custom;
Name: "alt"; Description: "32-bit"; Types: full compact custom;
This will create 2 option in Components page.If User choose one then other one can not be installed.
Here is the sample script:
[Files]
Source: "C:\Users\jorda_000\x64"; DestDir: "{appdata}\Roaming\.mhks"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: sixfour
Source: "C:\Users\jorda_000\x32"; DestDir: "{appdata}\Roaming\.mhks"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: threetwo
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Components]
Name: "threetwo"; Description: "Main(32 bit)"; Types: custom; Flags: exclusive
Name: "sixfour"; Description: "Main(64 bit)"; Types: custom; Flags: exclusive
[Types]
Name: "custom"; Description: "Custom"; Flags: iscustom

Add a check box to not add the start menu icons

So this is probably really simple, and I've been looking and looking for an example, but can't seem to find one.
I just need to add a check box to select the option NOT to create a start menu shortcut to the screen where it says, "Select Start Menu Folder - Where should Setup place the program's shortcuts?". Just not sure how to do this. Help would be vastly appreciated.
Here's my code so far:
[Setup]
AppName=My Launcher
AppVersion=1.1
DefaultDirName={pf}\My Launcher
DefaultGroupName=My Launcher
UninstallDisplayIcon={app}\myLauncher.exe
Compression=lzma2
SolidCompression=yes
[InstallDelete]
Type: files; Name: "{app}\myLauncher.exe";
[Files]
Source: "myLauncher.exe"; DestDir: "{app}"
Source: "QtCore4.dll"; DestDir: "{app}"
Source: "QtGui4.dll"; DestDir: "{app}"
Source: "QtNetwork4.dll"; DestDir: "{app}"
Source: "QtSql4.dll"; DestDir: "{app}"
Source: "Readme.txt"; DestDir: "{app}"
[Icons]
Name: "{group}\My Launcher"; Filename: "{app}\myLauncher.exe"
Under the [Setup] section, try adding this to the end:
AllowNoIcons=yes
See here for the official documentation on this property.

Resources