Install the same file to multiple destination folders in Inno Setup - inno-setup

Is it possible to define more than one destination folder in Inno Setup script?
example:
Source: "Test.exe"; DestDir: "{app}" // here I need a second folder
Thanks!

Why not add the file twice with differen DestDirs? Haven't tried, but should work. Otherwise it's hard to make a suggestion without knowing what exactly you're trying to achieve. There might be better ways, if only we knew what you're trying to do :-)

Related

Multiple output directories

Is it possible to use as an output directory not only one location?
Something like this:
[Setup]
OutputDir=C:\MyProject; C:\Installers
No, you cannot.
If you are compiling the installer as a part of a larger build process, you can clone the output files as part of that.
See also:
Run a [Code] or PowerShell script in Inno Setup compiler
One possible hack would be to execute some script in the background using preprocessor (as shown in the answer to the question above). And have the script watch for changes to the output file and copy it over to the other destination.

How to support thousands of files using Inno Setup?

I'm using Inno Setup to write an installer for an application based on Node.js. Then our node application (including modules) consists of almost 4,000 files. The installer needs to copy all of these files, as well as remove them during uninstallation.
I've already written this to use a ZIP file which gets extracted during installation, and recursively delete files during the uninstall. But I would have to write a tremendous amount of code to be able to properly handle file copy/replace/delete operations, while I could register them in my Inno Setup script and let the installer do all that work (as it's designed to do). The problem with that is I'm not about to manually write almost 4k lines of code (and manage them when frequent additions are made) for each file. I could write a small app to iterate through the files and write ISS script, but that's another project I'm not about to start.
Is there a way to not only add, but manage groups of files in bulk in recursive folders? Perhaps a custom IDE meant for this?
There are many way to add all files to inno setup:
You can use Flags: recursesubdirs;
For example:
[Files]
Source: "C:\Source Folder\*"; DestDir: "{app}"; Flags: recursesubdirs
You can use inno setup quick start pack
You can install Only Istool
TO put files in Istool open Files and directory section in Istool Drag and drop all (Select Thousand of files or Folder if any with Ctrl+A)
Thousand Of files in the Files and directory section of Istool and save.
PS: If you use Istool then save the Documents and open with inno setup.
I personaly Use Istool.
Thanks

three components in three user defined locations

I saw this excellent article: Inno Setup - Correct use of [Types], [Components] and [Tasks] on components and types.
I currently have three separate setup.exe projects (iss) to install:
The program executable (default to: C:\ProgramFiles/ ) i.e. {pf}
a setup of js/css/html (default to: c:\wwwroot\sherlock
a setup to install image files (jpg/png) files (default to: c:\wwwroot\toby
I want the user it be able to redirect the default locations for each of these three "components" (i.e. perhaps his /wwwroot is on the G drive, or something like that. I don't see anyway in the Source: command other than to send this to {app}
Source: "Z:\EGPL Librarian Releases\Sample Installation\wwwroot\Sherlock\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Question: can this be done with components and types as the above article?
Should I rather create an installer of installer programs and keep the three separate setups? (And can you show me an example of an installer of installer programs?)
I am looking for a simple solution, since I have other work to do.
See this page. Note that it was written for an older version of Inno, but it should be easy enough to adapt.
Components/Tasks are for optional things. If your items are not optional then there's not much point in using them.
As for whether to make a single installer or an installer of installers -- the main question there is what you want to happen at uninstall time. If you want the user to be able to uninstall each part separately then you must create separate install scripts with unique AppIds (and then optionally make an installer of installers for them). If you want them to always be uninstalled together then you can make a single script.

How can you harvest files for Inno Setup

I am trying to find a tool similar to heat for WiX that will allow me to harvest file and folder entries for Inno Setup. Is there anything available?
Edit: Heat is used to harvest installation artifacts (files, folders, registry entries, etc) from a machine and generate a WiX source file. I know Wise for Windows Installer had a wild card option that performed a similar function. I have not found anything similar for Inno Setup.
I am trying to include hundreds of files (dozens of folders) of sample projects and data to go with our application installation. These will change between releases and I was hoping to automate this portion of the installation authoring.
You can include an entire directory tree via wildcards and recursion, eg:
[Files]
Source: somewhere\root\*; DestDir: {app}\Data; Flags: recursesubdirs
(If you want to include empty directories as well, add the createallsubdirs flag too.)
There is no direct equivalent for registry entries, but eg. ISTool can convert a .reg file into the corresponding [Registry] entries.

How do I build two different installers from the same script in Inno Setup?

I want to make a "standard" install for external use, but I also want to use the same script and tell it (with a command line param perhaps?) to include another set of files (PDB files for debugging) for our lab installations. (And make a totally different install exe)
How can I do this? Is it possible?
I don't see how to set this in the [Files] section (conditionally add files based on some value/param)
Note – this is not for allowing the user an option DURING the install. I want a build-time option to set in my hudson build or batch file.
I suppose I can just create a separate installer for the pdbs, but I'd rather just have one file to do everything.
You can simply use
#ifdef DebugVersion
File: *.pdb ...
#endif
and then call the Inno compiler like this:
iscc.exe -DDebugVersion ...
I'd also add something like this so you get different output file names:
#ifdef DebugVersion
OutputBaseFileName=mysetup-dbg
#else
OutputBaseFileName=mysetup
#endif
Note that you'll probably need the InnoSetup precompiler for this, which, for some inexplicable reason, is not part of the default InnoSetup package. The easiest way to get it is to get the "Quick Start Pack" from the InnoSetup download page.
The answer is simple: create two files for each release, but put the common stuff in a third file and #include it in the other two.
http://rickborup.blogspot.com/2006/09/inno-setup-include-directive.html

Resources