Inno Setup can run in "update mode"? - inno-setup

The situation is the following:
I have an first installer that correctly generates everything necessary for a first use of my product, this means that it creates the paths, registers the DLLs; font files (TTF); it deposits the corresponding EXE file and other normal installer stuff.
Besides, we have created a second installer to carry out the periodic update of the product, that is, to update "only" the EXE file with certain frequency.
Both installers perform version control of the mentioned executable file, in this way:
#define MyAppVersion GetVersionNumbersString(AddBackslash(SourcePath) + "MyProg.exe")
; ---> And now, the above value is stored in these registry keys:
#define RegKey "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
#define RegKeyWOW6432="SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
[Setup]
AppVersion={#MyAppVersion}
...and both installers share the key GUID:
[Setup]
AppId={{xxxxxxxxxxx}
But, when that second installer is run, it first does a complete uninstall of all pre-existing files (both the old EXE and the rest) and then installs its contents, leaving only the new EXE file in the destination.
How do I keep all the original files and only update the EXE file periodically?
Thanks for any idea. Best regards,

Related

Add file after generating the installer executable

I would if we can add some files(text or executable) to a NSIS installer with a tool(or not) after the package is done.
Thank you for your help
You cannot really append extra files after the compiler has finished. You can however append a small text string if you need to embed some sort of id/hash/serial number. This data can be read with the ReadCustomerData function from the NSIS wiki.
You can compile installers on Windows and POSIX based systems so you can build installers anywhere if you absolutely need to add a file that does not exist on your system...

Reg:ILMerge for exe files

I am trying to merge two exe file using ILMerge. When I execute the merged exe, it is only execuing the primary exe..Could any one tell me how an ILMerge can be used for merging the exe files
Based on information from here and here, what you want is not possible. Only one EXE can run.
For ilmerge.exe, the first file argument is treated as primary, others will be packaged as DLLs. How the primary file will work is something you can control using a command line argument t (you need /t:exe, but it will only run one file, the first one).
The t parameter is used to set output type: exe for Console app, winexe for Windows forms, librarys for DLL.

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

how to display please wait dialog during EXEC() function

how to display please wait dialog while EXEC() runs another application silently.
You can use a ProgressOutputWizardPage, which works just fine for me, which isn't exactly complicated. You can refer to the CodeDlg.iss example.
Do you really need it to be a message box? As you might know, you can run an external *.exe during setup, and have a custom status message shown meanwhile. (The status message will be on the usual progress label during installation.)
I have a setup.exe that installs product A. This setup.exe contains a setup2.exe file, used to setup product B. setup.exe copies setup2.exe to the Program Files folder during the installation of product A. When all files have been copied, setup.exe then starts setup2.exe in the background. To accomplish this, i have done
[Run]
Filename: "{app}\setup2.exe"; StatusMSG: "Installing Product 2..."; Parameters: "/VERYSILENT /SUPPRESSMSGBOXES"
in setup.iss (that compiles to setup.exe). setup2.exe is also an Inno Setup installer, so the parameters "/VERYSILENT /SUPPRESSMSGBOXES" will make the installation of product 2 silent. During this setup, setup.exe will show the message "Installing Product 2...".
If you really need a message box to popup with the status message, you'll have to resort to Pascal scripting.

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