So I basically have a .zip file in my {tmp}
directory, and want to extract it's contents in {tmp}
but only when my third form is done with it's work, not earlier. The reason is: Because in the third form I download this .zip from the internet and it is saved into {tmp}
. Now after this I want to extract these files into {tmp}
from which I am to get the files from the extracted folders, like the release notes, license agreement files to use in the rest of the forms in the installer. Meaning, already in the form after the third one, I am using the files extracted.
I can't find anywhere how to do this after a certain form. I only found in the run section how extracting is done.
EDIT: The old way I described proved not to work well on some Windows versions. It may pop up a dialog window instead of overwriting files silently. This is easy to google: CopyHere ignores options.
The new way:
The new way uses 7zip standalone console version. It is a single
7za.exe
, you don't need the DLLs.If you want to download, unzip and use files (for example, as license agreement) before the installation starts, I can only give the general guideline:
[Setup]
:DisableWelcomePage=no
.idpDownloadAfter(wpWelcome);
. Now it downloads right after "Welcome" page.[Setup]
:LicenseFile=license.txt
for license page to show up. Or probably not empty, but with "Loading license agreement..." text.procedure CurPageChanged()
: if current page iswpLicense
then you callExec()
function to launch 7zip and wait for it to terminate. No 7zip in[Run]
section now. Then you probably useLoadStringFromFile()
function to get license agreement from extracted file. Then put it into UI. ProbablyWizardForm.LicenseMemo.RTFText = ...
should work. Anyway, UI is accessible, if you have trouble setting the text, ask a separate question on this.The old buggy way:
An equivalent, cleaner way without
unzipper.dll
is described here. One way or another, it uses buggy CopyHere Windows feature.You can probably try other things instead of
wpReady
andssPostInstall
. For my small zip this works well.