Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inno Setup default install folder change

Every time I compile my installer the default installation directory is C:\Program Files\Company\Product and I don't seem to be able to change it. Here's what I got under Setup:

[Setup]
AppName=MyProduct
AppVerName=MyProduct
AppPublisher=Company
DefaultDirName=C:\MyStuff\Company\MyProduct
DefaultGroupName=Company\MyProduct
UninstallDisplayIcon={app}\MyProduct.exe
UninstallDisplayName=MyProduct Uninstall
PrivilegesRequired=poweruser
OutputDir=userdocs:Inno Setup Examples Output
OutputBaseFilename=Setup
DisableDirPage=false
DisableProgramGroupPage=true
VersionInfoCompany=Company Inc
VersionInfoProductName=MyProduct
AllowUNCPath=false

Based on the documentations, DefaultDirName should dictate the default install folder. But it doesn't.

My case in particular is that, I want to set the default install folder on x64 machines to C:\Program Files, but the installer always picks Program Files (x86) no matter what I put in the DefaultDirName.

like image 822
Mossi Avatar asked Mar 25 '13 00:03

Mossi


2 Answers

The last selected installation folder has the precedence before the DefaultDirName directive value if the UsePreviousAppDir directive is set to yes, which is by default. If you want to force the directory specified by the DefaultDirName to be selected, turn off the UsePreviousAppDir directive.

If you want to keep the functionality with the last directory, and just overcome this for your testing, simply uninstall the previous installation before you run the new built setup.

like image 66
TLama Avatar answered Sep 20 '22 14:09

TLama


Just add "UsePreviousAppDir=no" in your iss file:

[Setup]

...

UsePreviousAppDir=no

like image 25
SLdragon Avatar answered Sep 18 '22 14:09

SLdragon