1
votes

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?

1
I would assume it is possible to tell InnoSetup to use a directory as a source for the installer, instead of the individual files in that folder. If you look here: jrsoftware.org/ishelp/index.php?topic=filessection it looks like Inno Setup supports specifying directories as a source. Does this do what you're looking for?OSborn
Source: "C:\DirWith1000FilesAndFolders\*"; DestDir: "{app}"; Flags: ignoreversion createallsubdirs recursesubdirs - all files and folders will be included and then deleted during uninstall. You can Exlude files on demand with Excludes: "list of file to be excluded"RobeN
Note that you only need the createallsubdirs flag if you want to preserve empty dirs, which is rarely necessary in practice but everyone seems to include it anyway without thinking about it. :)Miral
@Miral - there are apps that do need empty dirs :) Try to play e.g. Gothic 1 without Saves folder - game will crash on saving as it is unable to create (in fact Move) Current Savegame Folder to Saves directory if it doesn't exist. So it is safer way to create even empty dirs if you do not fully know how does specific app work.RobeN
I know they do exist, but they shouldn't. :) It's something to fix rather than something to enshrine.Miral

1 Answers

3
votes

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