I use Inno Setup for many "standard" installers, but for this task I need to extract a bunch of temp files, run one of them, then remove them and exit the installer (without actually installing anything).
Basically I'm looking to make a self-extractor with without it being an "installer", and am after the best user experience possible with inno setup.
I have the following code which almost works fine:
[Files]
Source: "dist\*"; Flags: recursesubdirs ignoreversion dontcopy;
[Code]
function InitializeSetup(): Boolean;
var
ResultCode: Integer;
begin
Result := True;
MsgBox('Please wait a minute or two...', mbInformation, MB_OK);
ExtractTemporaryFiles('{tmp}\*');
Exec(ExpandConstant('{tmp}\MyScript.exe'), '', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
Abort();
end;
The problem is that the best I can do here is show a message box "Please wait a minute or two...", the user clicks [Ok], then waits as nothing appears to happen with nothing on-screen at all, then MyScript.exe
starts.
What I'd like instead is a Wizard page saying "Please wait as temporary files are extracted..." with a npbstMarquee
style progress bar, then is disappears once the files are extracted and my script starts.
I don't think there's a way to tell Inno Setup to display a progress bar while ExtractTemporaryFiles()
is going (which would be ideal) and working this into a custom wizard page has got me baffled.
{tmp}
, instead of using ExtractTemporaryFiles
;{tmp}
from Run
section (or use AfterInstall
parameter or CurStepChanged
to trigger Pascal Script code after files are installed);Uninstallable
to no
;CreateAppDir
to no
;[Messages]
section to edit the wizard texts that are too installer-centric for your needs.[Setup]
Uninstallable=no
CreateAppDir=no
[Files]
Source: "dist\*"; DestDir: {tmp}; Flags: recursesubdirs
[Run]
FileName: "{tmp}\MyScript.exe"
Notes:
{tmp}
folder gets automatically deleted, when the "installer" is closing;ignoreversion
flag, when installing to new empty folder.A related question: Inno Setup installer that only runs a set of embedded installers
For an answer your literal question, see Inno setup: ExtractTemporaryFile causes wizard freeze. Or a more generic question on the topic: Inno Setup: How to modify long running script so it will not freeze GUI?