I am creating an installer using Inno Setup and I have a file whose name changes every release (because the file name has the version number embedded in it):
#define MY_FILE_NAME "file_1.0.0.jar"
[Files]
Source: {#MY_FILE_NAME}; DestDir: {app}; Flags: ignoreversion
How would I make my installer remove file_1.0.0.jar from the install location when installing file_2.0.0.jar?
I added an [InstallDelete] section which seems to do the trick:
[InstallDelete]
Type: files; Name: "{app}\file_*.jar"
Related
Is there a way to dynamically fill the [Dirs] and [Files] sections of an Inno Setup script?
Here is what I am trying to do:
during the install process, the user will select foo (foo matches a repository to get from our SCM)
Setup will run a batch to checkout foo from our SCM
then the content of foo must be added to the [Dirs] and [Files] sections of the script
Everything works fine except for the last step. I searched around and couldn't find explanations on how to do this. I have the feeling that my script should embed all the repositories of our SCM to then be able to copy only the selected ones to the destination directory.
Thanks for your help!
Regards,
See Inno Setup Prompt for external file location.
And add the recursesubdirs flag.
You may also need the createallsubdirs flag (assuming from your reference to the [Dirs] section).
[Files]
Source: "{code:GetScmPath}"; DestDir: "{app}"; \
Flags: external recursesubdirs createallsubdirs
[Code]
function GetScmPath(Param: string): string;
begin
Result := { make it return path to the checked out files }
end;
I want to have a checkbox at the finishpage of InnoSetup to open or not the readme file. I try something like this (like it's explain here flag postinstall but it seems doesn't works:
Name: "StartAfterInstall"; Description: Display the PDF Readme File; Languages: english
Filename: "{app}\readme.pdf"; Tasks: StartAfterInstall; Flags: shellexec postinstall runasoriginaluser; Languages: not French
It propose only to launch the program. Is there a way to do this without use the [code] section in Inno Setup or not?
For this task simply mark your readme file entry in your [Files] section with the isreadme flag and let the Inno Setup do the rest for you:
[Files]
Source: "Readme.txt"; DestDir: "{app}"; Flags: isreadme
The isreadme flag is described as (emphasized by me):
File is the "README" file. Only one file in an installation can have
this flag. When a file has this flag, the user will asked if he/she
would like to view the README file after the installation has
completed. If Yes is chosen, Setup will open the file, using the
default program for the file type. For this reason, the README file
should always end with an extension like .txt, .wri, or .doc.
Note that if Setup has to restart the user's computer (as a result of
installing a file with the flag restartreplace or if the AlwaysRestart
[Setup] section directive is yes), the user will not be given an
option to view the README file.
I have this line in .iss file:
Source: "..\Tcl\*"; DestDir: "{app}\Tcl"; Flags: ignoreversion
which packs folder Tcl. But it takes only files inside folder, but does not take subfolders inside Tcl. Is there a way to take entire folder Tcl with all subfolders and files? (without listing all that subfolders line by line).
Inno Setup 5.4.2.
Yes, there is. Simply include the recursesubdirs flag to your [Files] section entry. The help says about this flag the following:
Instructs the compiler or Setup to also search for the Source
filename/wildcard in subdirectories under the Source directory.
So, all you should do is modify your [Files] section entry this way:
[Files]
Source: "..\Tcl\*"; DestDir: "{app}\Tcl"; Flags: ignoreversion recursesubdirs
You can also use the Inno Wizard, but you'll need to correct the script afterwards if you would like those files to stay in the folder they're imported from, because the Wizard will put them in the app default folder.
The wizard wil generate:
[Files]
Source: "..\Tcl\*"; DestDir: "{app}; Flags: ignoreversion recursesubdirs
If you need to maintain the folder structure you'll need:
[Files]
Source: "..\Tcl\*"; DestDir: "{app}\Tcl"; Flags: ignoreversion recursesubdirs
Inno Wizard Update as of 5.6.1 (08/14/2018)
The Inno Setup Script Wizard now has the option to specify a subfolder. On the Application Files step of the wizard, use the Add Folder... button, then after you select the folder you would like to add, make sure it is selected in the list and then click Edit... and under the Destination Subfolder textbox, specify where you would like the previously selected folder contents to go.
I am programming my Inno Setup Compiler that I was asking about earlier but had encountered a problem . How do I let the Installer add a Read me File?? I am using Inno Setup Compiler 5.5.3 and uses the following command "AppReadmeFile=C:\Users\Cordre\Desktop\D_C Databasis Tools\Read me.txt" in Inno but if I install the program their is no Read Me file in the Program files.
The text document does exist and is called correctly double checked that.
Is their any other command that I also have to use?
From the documentation on AppReadmeFile:
This string, which may be a URL, is displayed on the "Support" dialog
of the Add/Remove Programs Control Panel applet in Windows 2000/XP and
later. The value may include constants.
This directive has nothing to do with a README file in the Program Files directory. If you want a copy of the README in the Program Files directory, you'd need to add it to the [Files] section. For example:
[Files]
Source: "MyReadme.txt"; DestDir: "{app}"; Flags: ignoreversion
You can also add an icon to the file using the [Icons] section. According to the documentation, a sample Icons entry would be:
Name: "{group}\My Program"; Filename: "{app}\MYPROG.EXE"; WorkingDir: "{app}"
I am trying to figure out how to rename a file in the file section while building the setup file.
I want to include a Local.config file but extract it as Local.config.tmp
I can't figure out why Inno Setup keeps creating folders instead of renaming files. So far I have this, but it keeps creating folders named Api\Local.config.tmp.
Any ideas?
[Files]
Source: "Api\Local.config"; DestDir: "{app}\Api\Local.config.tmp"; Flags: ignoreversion recursesubdirs
It's creating a folder as that's what you told it to do.
Try specifying a destination name:
[Files]
Source: "Api\Local.config"; DestDir: "{app}\Api\"; DestName: "Local.config.tmp"; Flags: ignoreversion recursesubdirs