Changing the default Inno Setup installation folder

Every time I compile my installer, the default installation directory is C: \ Program Files \ Company \ Product, and I seem to be unable to change it. Here is what I got under installation:

[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 documents, DefaultDirName should indicate the default installation folder. But this is not so.

In my case, in particular, I want to set the default installation folder on x64 computers to C: \ Program Files, but the installer always selects Program Files (x86) regardless of what I entered in DefaultDirName.

+7
source share
1 answer

The last selected installation folder takes precedence over DefaultDirName if the UsePreviousAppDir directive is set to yes , which is the default. If you want to force the selection of the directory specified by DefaultDirName , disable UsePreviousAppDir .

If you want to keep the functionality with the latest directory and just overcome it for your testing, just uninstall the previous installation before starting the new built-in setup.

+16
source

All Articles