Skip to content

Instantly share code, notes, and snippets.

@informationsea
Created February 8, 2023 03:44
Show Gist options
  • Save informationsea/71c37670edff299053a115eb06bfb7a6 to your computer and use it in GitHub Desktop.
Save informationsea/71c37670edff299053a115eb06bfb7a6 to your computer and use it in GitHub Desktop.
Nothing Installer with InnoSetup
[Setup]
AppId={{3DD1237A-78BD-4E14-9AC6-2376BE4E3B1B}
AppName="Nothing Installer"
AppVersion=1.0
Uninstallable=no
OutputBaseFilename=nothing-installer
DefaultDirName={autopf}
DisableDirPage=yes
DisableProgramGroupPage=yes
Compression=lzma
SolidCompression=yes
WizardStyle=modern
ArchitecturesAllowed=x64
[Languages]
Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl"
; https://stackoverflow.com/questions/39825271/how-to-delay-without-freezing-in-inno-setup
[Code]
procedure CurStepChanged(CurStep: TSetupStep);
var
ProgressPage: TOutputProgressWizardPage;
I, Step, Wait: Integer;
begin
if CurStep = ssPostInstall then
begin
// start your asynchronous process here
Wait := 10000;
Step := 50; // smaller the step is, more responsive the window will be
ProgressPage :=
CreateOutputProgressPage(
WizardForm.PageNameLabel.Caption, WizardForm.PageDescriptionLabel.Caption);
ProgressPage.SetText('10秒間待っています...', '');
ProgressPage.SetProgress(0, Wait);
ProgressPage.Show;
try
// instead of a fixed-length loop,
// query your asynchronous process completion/state
for I := 0 to Wait div Step do
begin
// pumps a window message queue as a side effect,
// what prevents the freezing
ProgressPage.SetProgress(I * Step, Wait);
Sleep(Step);
end;
finally
ProgressPage.Hide;
ProgressPage.Free;
end;
end;
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment