Inno Setup the setup wizard size is fixed, but I want to change wizard setup size and change a few items including image and …
How to change wizard size (width and height) in an Inno Setup installer
inno-setup
Related Solutions
I have used the following. I'm not sure it's the simplest way to do it but it works.
This uses {#emit SetupSetting("AppId")}
which relies on the Inno Setup Preprocessor. If you don't use that, cut-and-paste your App ID in directly.
[Code]
{ ///////////////////////////////////////////////////////////////////// }
function GetUninstallString(): String;
var
sUnInstPath: String;
sUnInstallString: String;
begin
sUnInstPath := ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\{#emit SetupSetting("AppId")}_is1');
sUnInstallString := '';
if not RegQueryStringValue(HKLM, sUnInstPath, 'UninstallString', sUnInstallString) then
RegQueryStringValue(HKCU, sUnInstPath, 'UninstallString', sUnInstallString);
Result := sUnInstallString;
end;
{ ///////////////////////////////////////////////////////////////////// }
function IsUpgrade(): Boolean;
begin
Result := (GetUninstallString() <> '');
end;
{ ///////////////////////////////////////////////////////////////////// }
function UnInstallOldVersion(): Integer;
var
sUnInstallString: String;
iResultCode: Integer;
begin
{ Return Values: }
{ 1 - uninstall string is empty }
{ 2 - error executing the UnInstallString }
{ 3 - successfully executed the UnInstallString }
{ default return value }
Result := 0;
{ get the uninstall string of the old app }
sUnInstallString := GetUninstallString();
if sUnInstallString <> '' then begin
sUnInstallString := RemoveQuotes(sUnInstallString);
if Exec(sUnInstallString, '/SILENT /NORESTART /SUPPRESSMSGBOXES','', SW_HIDE, ewWaitUntilTerminated, iResultCode) then
Result := 3
else
Result := 2;
end else
Result := 1;
end;
{ ///////////////////////////////////////////////////////////////////// }
procedure CurStepChanged(CurStep: TSetupStep);
begin
if (CurStep=ssInstall) then
begin
if (IsUpgrade()) then
begin
UnInstallOldVersion();
end;
end;
end;
Alternatives
See also this blog post "Inno Setup Script Sample for Version Comparison" which goes one step further, and reads the version number of any previously installed version, and compares that version number with that of the current installation package.
You can use the Inno Setup Preprocessor GetVersionNumbersString
function like this
#define ApplicationName 'Application Name'
#define ApplicationVersion GetVersionNumbersString('Application.exe')
[Setup]
AppName={#ApplicationName}
AppVerName={#ApplicationName} {#ApplicationVersion}
VersionInfoVersion={#ApplicationVersion}
Best Answer
Inno Setup 6
Inno Setup 6 supports changing a size of the wizard window.
You can use
WizardSizePercent
to change a size of the wizard window.You can also use
WizardResizable
to allow the user to resize the wizard (this is default behaviour, if you use themodern
WizardStyle
).Inno Setup 5
There's no magic way to make the wizard pages larger. They are designed for a specific size. If you want to make them larger, you have to go page-by-page, control-by-control and carefully decide how to layout them for your new size.
The following code is just an example, you may want to choose another change in layout.
Use the
GrowWizard
function from theInitializeWizard
event function (or elsewhere), giving it a change in width and height as parameters:The code takes care of the following pages:
WelcomePage
LicensePage
SelectDirPage
SelectComponentsPage
SelectTasksPage
ReadyPage
InstallingPage
FinishedPage
Other, less common, pages are left as an exercise to the readers:
Similar questions: