Two choices for separate added folders - inno-setup

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

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

Inno Setup Make dirs and files read only

I'm new user in Inno Setup. My problem is that I have some folders and one file. I want to make a setup package to install all of them. Here is my code
[Files]
Source: "D:\POS CAD Standard\CAD\*"; DestDir: "C:\POS CAD Standard"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "D:\POS CAD Standard\acad.lsp"; DestDir: "{userappdata}\Autodesk\AutoCAD 2014\R19.1\enu\support"; Flags: ignoreversion
[Dirs]
Name: "C:\POS CAD Standard"; Attribs:readonly hidden system; Permissions: users-readexec;Flags:
[Icons]
Name: "{group}\{cm:UninstallProgram,POS CAD Standard}"; Filename: "{uninstallexe}"
It works fine, but when I'm trying to setup to another PC my source file is not found, and I want to make some files (not folder) to be read only.
Use Attribs: readonly parameter.
It is supported both in the [Files] and [Dirs] sections.
Source: "D:\POS CAD Standard\CAD\*"; DestDir: "{sd}\POS CAD Standard"; \
Flags: ignoreversion recursesubdirs createallsubdirs; Attribs: readonly
Note that I've used the {sd} constant instead of hardcoding the C: drive (what is a bad practice).

Exclude files working not as expected?

I want to exclude 2 folders by default, unless a component is checked. I don't have all the files individually listed in the [Files] section, as some of them might be added/removed in the future, but there are 2 folders that I need to control.
Here's the code I have:
Source: "source\*"; DestDir: {app}; Excludes: "\plugins\api,\plugins\shared memory"; Flags: ignoreversion recursesubdirs createallsubdirs;
Source: "source\plugins\api\*"; DestDir: {app}; Flags: recursesubdirs createallsubdirs;
Source: "source\plugins\shared memory\*"; DestDir: {app}; Components: plugins_api; Flags: recursesubdirs createallsubdirs;
What I want:
Those subfolders (api and shared memory) should only be copied if
plugins_api is selected.
If the component plugins_api is not
checked, they should not be copied.
I'd rather avoid including
every file in the .iss file. It is not an option.
What I get with this code:
If the component is not checked, the folders are not copied. Ok.
If the component was checked, the folders are not copied. Not ok.
So it seems the exclude in the first line affects the other 2 lines. How can I avoid this?
2 points:
1) You only have the Components entry on one of the special folders.
2) The special folders, as you have them will be installing their contents direct into the {app} folder.
If you follow the folders in use:
Source: "source\plugins\api\*"; DestDir: {app};
Put contents of source\plugins\api\ in {app}
I expect you want something like:
Source: "source\plugins\api\*"; DestDir: {app}\plugins\api\; Components: plugins_api; Flags: recursesubdirs createallsubdirs;
Source: "source\plugins\shared memory\*"; DestDir: {app}\plugins\shared memory\; Components: plugins_api; Flags: recursesubdirs createallsubdirs;

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

Admin user always prehend initial user

Using an InnoSetup script (that seems to work fine under XP/Vista), i've a strange behavior under Seven RC:
here is the [Files] section:
[Files]
Source: *.ico; DestDir: {app}\bin; Flags: ignoreversion
Source: dist\*.*; DestDir: {app}\bin; Flags: ignoreversion
Source: catalog\*.*; DestDir: {userappdata}\JetWorksheet\catalog; Flags: recursesubdirs createallsubdirs onlyifdoesntexist uninsneveruninstall
Source: wizards\*.*; DestDir: {userappdata}\JetWorksheet\wizards; Flags: recursesubdirs createallsubdirs onlyifdoesntexist uninsneveruninstall
Source: images\*.*; DestDir: {userdocs}\JetWorksheet\images; Flags: recursesubdirs createallsubdirs
Source: wordlists\*.*; DestDir: {userdocs}\JetWorksheet\wordlists; Flags: recursesubdirs createallsubdirs
The problem is:
In place of using the {userappdata} of the user that started the setup, all the data goes to the "Admin" directories...
I'm surely missing somethings...
You should either use PrivilegesRequired=lowest so your Setup doesnt elevate, or you should place the default user files in a common directory during installation, and then have your application copy them to the user area on startup.

Resources