How to eliminate spaces for installation while writing Inno setup file? - inno-setup

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.

Related

How to install msi file in silent mode inside an InstallShield project

I have an InstallShield project which consists of two files and several folders,
MainSoftware.exe
AuxSoftware.msi
FolderA
FolderB
etc...
The main purpose of the project is just copying all of these files in the path specified by the user. It is very simple. However, after copying AuxSoftware.msi in the destination path, I need that a silent installation begins with this file. I know that a silent installation can be run by the following command:
msiexec /i AuxSoftware.msi /qn
But I don't know how to tell InstallShield that this command must be executed in the destination path after copying AuxSoftware.msi.
Could you please help me?
Thanks in advance
You can only execute one installer at a time once it is in the InstallExecuteSequence. Stein has a very good, brief explanation in the answer here.
I would suggest using a bootstrapper (setup.exe) that can install them in sequence.
Thanks for your suggestions. I found a way. They call it "nested installations". I created a Custom Action having the second .msi or .exe installer I want to run after a specific point in the process of the main installation.

setup.iss file is not generated

I have a installshiled project which generates setup.exe file. I'd like to enable silent install by generating proper setup.iss file. I ran the following command:
Setup.exe /r
which lunched the installer, but it never created the setup.iss file. I looked in C:\Windows as the documentation suggested, as well as some other locations (local directory, program files etc.)
Why isn't it created and how to fix?
Thanks,
Ok I found the problem, and a workaround:
The problem was that my msi project was a Basic MSI Project, as opposed to InstallScript and InstallScript MSI projects. This kind of project does not support reading a response file (aka setup.iss). However, there is a way to perform silent installation for the .msi / setup.exe file:
Setup.exe /s /v"/qn"
will do the trick.
All of this information can be found here
Another option is to explicitly state where you want the setup file generated, using the /f1 option:
Setup.exe /r /f1"C:\your\path\here\setup.iss"
Documentation on this can be found here, but here is a summary from that link:
Using the /f1 option enables you to specify where the response file is (or where it should be created) and what its name is, as in Setup.exe /s /f1"C:\Temp\Setup.iss". Specify an absolute path; using a relative path gives unpredictable results. The /f1 option is available both when creating a response file (with the /r option) and when using a response file (with the /s option)

InstallShield - adding configurations to file

I'm building a setup project by using InstallShield. The setup file will do the following tasks:
Install my application to the machine.
Look for a folder based on a common string (e.g: MySecondApp) because each machine might has different folder name:
Laptop1: C:\Program Files\WindowsApp\MySecondApp_1.2.3.4_asdfsjhewrnewj
Desktop2: C:\Program Files\WindowsApp\MySecondApp_1.2.3.5_asdfsjhewrnewj
In this folder, I have a config file named "myconfig.cfg". My setup file will modify this file by adding some new configurations.
Could you let me know how to do this by using InstalledShield?
Thank you very much
I've resolved this problem by writing a C# library and use it in InstallShield for searching and modifying my config file.

Microsoft.WindowsAzure.targets "The specified path, file name,or both are too long"

I am trying to publish a project to Windows Azure but get an error in the generated Microsoft.WindowsAzure.targets file related to length of paths and file names. How can I determine which is the problematic path or filename. The error relates to the "" tag in the generated file
Thanks
Martin
Already an older post - did you check this post?
Path too long error when building a windows azure service
This might reslove your issue.
Since this was still a problem for me years later and the above doesn't apply to Azure SDK v2.8, I was able to solve it by creating a symbolic link to my projects folder. Open up the command prompt as an administrator and run this:
mklink /D C:\Dev C:\Users\danzo\Source\Workspaces
Obviously you can change "C:\Dev" to whatever you want it to be and you'll need to change the longer path above to the root directory of your soltions/projects folder.

Extended NSIS plugins directory

I am building a plugin for NSIS with VS 2010 and I would love to set up the project so that a test setup is automatically built from a simple NSI file.
All seems fine except I can't figure out how to make NSIS look for my plugin in my project's output folder instead of C:\Program Files (x86)\NSIS\Plugins\*.dll only.
Are there any commands I can put in my NSI script to make NSIS look for my freshly built plugin outside of "standard plugins folder"? It seems rather odd to have to copy my DLL each time I wanted to test it.
Any help is appreciated.
You can use !addplugindir directive, see nsis compile-time commands.
Use !addplugindir directive with defined symbol (/D on command line).
Symbol is "the path to your location of .dll file"
For VS 2010 is the best option to use Visual & Installer - free VS addin for developing NSIS installers directly in Visual Studio.
Set your symbol in Project properties:
Download here: www.unsigned-softworks.sk/visual-installer/
As others have mentioned, the !addplugindir directive in your NSI script file will do the trick, and you can define a variable to pass to that directive on the command line using /D.
As for the code to add to your NSI file, you need something like this:
!ifdef EXTRANSISPLUGINSFOLDER
!addplugindir "${EXTRANSISPLUGINSFOLDER}"
!endif
Then on the command line, you can call your NSI script like this:
makensis.exe /DEXTRANSISPLUGINSFOLDER=C:\somefolder\moreplugins\ YourInstallerScript.nsi
When defining the extra folder, you might find that having any spaces in the folder path causes problems, and using quotes around the path doesn't help. To work around this, try using the dir /x command in the Windows terminal to list the 8.3 DOS names for the folders with spaces in their name. This will help you build up a folder path that doesn't contain spaces. (eg C:\Program Files\ often becomes C:\PROGRA~1 when listed with dir /x from the root of C:)
May have missed the point here but could you not have used an XCOPY post build event to copy the output to the NSIS plugins directory?

Resources