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.
Related
my application has this directory that I need to include in the install package:
bin\Win Files\*
So, in the [Files] section, I have this line:
Source: "bin\Win Files\*"; DestDir: "{app}\bin\Win Files"; Flags: ignoreversion; Permissions: everyone-modify
But at compile time, it keeps saying it can't find that directory due to space in the path, the exact error message is:
No files found matching "C:\dev\packages\MyApp\bin\Win Files\*"
I've tried the following, all failed:
Source: """bin\Win Files\*"""
Source: "\"bin\Win Files\*\""
Source: '"bin\Win Files\*"'
That directory has to be named like that, so what should I do?
I use this:
[Files]
; Main application
Source: "{#SourceDir}\*"; DestDir: "{app}\"; Flags: recursesubdirs ignoreversion;
to copy all my files in one go to the installer. Note the recursesubdirs flag. I think spaces in the path (referenced here in the variable named SourceDir) are not actually a problem here.
This is due to the misunderstanding about the directory/file structure scanning mechanism in Inno Setup.
First of all, as #Martin Prikryl pointed out, one can include path that has space in it.
I think the following two rules are the key to this issue:
One cannot specify a folder that has no standalone files (e.g. empty folder or a folder that only has sub-directories). In my case: I have the following file structure per this question:
bin\Win Files\Libs\
bin\Win Files\Plugins\
So Source: "bin\Win Files\*"; will fail. If there is at least one standalone file under the "bin\Win Files\" folder, then the source line will work.
Inno Setup requires each folder be explicitly specified in the [Files] section as below:
Source: "bin\Win Files\Libs\*"; DestDir: "{app}\bin\Win Files\Libs";
Flags: ignoreversion; Permissions: everyone-modify
Source: "bin\Win Files\Plugins\*"; DestDir: "{app}\bin\Win Files\Plugins";
Flags: ignoreversion; Permissions: everyone-modify
as Source: "bin\Win Files\*"; will NOT include the sub-directories automatically, it is only used to include the standalone files under the bin\Win Files\ folder.
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
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
My application has a folder of files that are all marked as "hidden" (including the folder itself). However, Inno Setup won't copy them for installation unless I remove the "hidden" attribute first.
Fair enough, but is there a way to make Inno Setup mark the installed folder as "hidden" after it finishes setup on my end-user's machine?
Thanks.
See the Attribs parameter for entries in the [Dirs] section.
[Dirs]
Name: "{app}\blah"; Attribs: hidden;
Note that this won't really stop people from seeing it, just make it look like you have something to hide.
First of all, ensure that ONLY the directory is hidden, and not the subdirectory. Say its name is srcHiddenDir.
Now, create another directory dstHiddenDir, but dont make it hidden now. But it should be empty.
Then, open the settings.json, and replace all the occurrences of srcHiddenDir with dstHiddenDir.
Now, Make it ready to copy files as usual. In one part of the code, you will get:
[Files]
Source: "wherethewholecodeis\phpdesktop\phpdesktop-chrome.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "wherethewholecodeis\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "wherethewholecodeis\*srcHiddenDir*\*"; DestDir: "{app}\*dstHiddenDir*"; Attribs:hidden; Flags: ignoreversion recursesubdirs createallsubdirs
Then, you need to write:
[Dirs]
Name: {app}\dstHiddenDir; Attribs:hidden;
Name: {app}\dstHiddenDir\application; Attribs:hidden;
Name: {app}\dstHiddenDir\database; Attribs:hidden;
Name: {app}\dstHiddenDir\css; Attribs:hidden;
....
...and all the subdirectories you want to hide, just for more safety. But Note those subdirectories should be genuine, and there in the source/destination. Else, when you run the setup, error will show that these directories dont exist.
Now, compile the program.
Hope this helps.
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.