My application is installed by InnoSetup.
The user may change the installation folder when he starts install the application.
I'd like to store the installation path right after the user decided about it (during the installation process), into an INI file (My application holds an INI file that is stored in the roaming folder).
Is that possible? Can you tell me how to?
Thank you
Yes, it is possible. You can simply add an [INI] section entry like this into your script. There you can pass the {app} constant, which holds the selected directory path:
[INI]
Filename: "MyProg.ini"; Section: "InstallSettings"; Key: "InstallPath"; String: "{app}"
Related
I would like to create a folder on C drive with Inno Setup C:\A A Card Images
and I am assuming I can use the [Files]Source:"Path to Images" DestDir: "{app}"; Flags: ignoreversion
[Dirs]
Name: "C:\A A Card Images" This is what I have tried but it tells me File exists
So it seems obvious to me that I need to create the folder before I try to add Image files to the folder
So do I use [Dirs] or [Files] to create the folder?
And using DestDir: "{app}"; Flags: ignoreversion to load the Images into the folder seems wrong
Because I do not want the Images in the DestDir I want them in C:\A A Card Images
To create a new directory during the install, use the [Dirs] section. The Name is used to specify the location. Using "{app}\foldername" means to create the directory below the application's directory. To create it somewhere else, specify the full path to the directory.
[Dirs]
Name: "C:\Whatever"
Use the [Files] section to indicate the files you want to install, and the location of those files. You use DestDir to specify that location.
Note that users may not be pleased if you create directories and install files in non-standard locations. There are valid reasons that those standard locations exist. I personally don't like it when applications clutter my drive in places they shouldn't be using.
Is it possible to create the Inno Setup script to copy files from a UNC path on the network rather than statically adding them to the setup file?
If so, can it still be done if I need to authenticate to the path first? Is there a mechanism to provide authentication info in the Inno Setup script?
Essentially, I am wanting setup to just copy files from various sources over the intranet from a UNC path to put into the setup destination directory.
Yes, specify the UNC path in the Source parameter of the [Files] section entry and use the external flag.
[Files]
Source: \\UNC\path\file.txt; DestDir: {app}; Flags: external
To authenticate, you would have to call the WNetUseConnection or similar WinAPI.
See How to execute "net use" command from Inno Setup installer on Windows 7?
I always install my programs inside a subfolder of the C:\Soft . If I want to uninstall a program (Soft1) located inside a subfolder of the C:\Soft\, how to uninstall my program and delete C:\Soft whenever it is empty? (no other folders or files present in C:\Soft)
I am using this code to uninstall my program (Soft1):
[UninstallDelete]
Type: filesandordirs; Name: {app};
Sorry for my bad english.
If the parent folder of the installation is indeed fixed (you do not give user a chance to change it), just add a dirifempty entry to the [UninstallDelete] section for the C:\Soft:
[UninstallDelete]
Type: dirifempty; Name: "C:\Soft"
I have few SQL script files which have to run before installation begin. The reason is if SQL scripts run successfully only, I want to do the installation.
If the SQL scripts need to run after the installation, I can copy the files to {app} path and run the files from there. But the requirement is run the files before installation begins. I am confused. What is the best way of doing it?
Say for example if it is a single file I can put it under Files section and can use ExtractTemporaryFile('FileName');
But as I mentioned, I have many files (in SQLSCRIPTS folder). What is the better way? (One solution is I can make it as a single file by zipping it and then unzip it)
[Files]
Source: "C:\\SQLSCRIPTS\\*"; DestDir: "{app}"; Flags: dontcopy
To extract multiple files from installer, use the ExtractTemporaryFiles, like:
ExtractTemporaryFiles('*.sql');
I am creating an installer for my project where I am facing a issue.
The project is not running as expected if it is installed in the directory which contains spaces e.g: "C:\Program Files (x86)" and it is working fine if it is installed in a directory which doesn't contains spaces e.g: "C:\Python27".
So as per my understanding there is nothing wrong with project side and its all with the .iss code.
So can anyone please tell me how to solve this issue. Since most of the installers are created using Inno setup and they are installed in the program files there will be a way to solve this and which I am not aware of it.
Regards,
Bharathi
The issue is not with the spaces. My application creates a log file to log the data. Since the normal user doesn't have rights to create the file in the program files folder the application is not working... The application should be run as admin to work.
Create a symlink using mklink.
Create something like this in [RUN] section:
Filename: {cmd}; Parameters: "/c MKLINK /D {sd}\ProgramPathNoSpaces ""{pf}\Program Path With Spaces"; Flags: RunHidden;
Run your application inside the ProgramPathNoSpaces, using a shortcut with the "start in" property defined.
Hope this help you, but everyone is right. The problem is in the application, this is only a workaround.