0
votes

I have created an installer using Inno Setup. The installer uses a packaged-in DLL to check availability of a specific device on the target machine. If the device is found, the installation is allowed to finish, otherwise the installation is rolled-back (rollback is done using below lines in script):

if <DeviceNotFound> then
begin
  CancelWithoutPrompt := true;
  WizardForm.Close;
end;

I have checked that the above check and rollback logic works fine if the setup is run with /silent cmd line param. However, when I use /silent param, the setup displays the Installation progress wizard form.

Also, I found that if I run the above setup in /verysilent mode, then the "DeviceNotFound" check logic works fine but the rollback logic doesn't work and it seems as if rollback logic doesn't get executed at all. Instead of performing rollback, the installer successfully installs.

Now, I have a requirement to run the setup silently so that no window is displayed but it must install or rollback based on device check. Therefore, I have the below queries:

  1. Can I rollback the installer when it is running in /verysilent mode? If so, please advise how it may be achieved. I can detect verysilent install mode as shown in question:
    How to detect whether the setup runs in very silent mode?

  2. Alternatively, can I Hide/Minimize the Installation progress window when it is running in /silent mode? If so, please advise how it may be achieved.

Please help me with my above queries.

Sorry to be so descriptive but I tried to explain my problem and queries!

EDIT

I am not doing the above mentioned check in InitializeSetup(). I am doing the check from a function invoked by AfterInstall directive from [Files] section. I have a limitation that I cannot do it from InitializeSetup() as the packaged-in DLL is not extracted till [Files] section completes. I also need to run the installer in Windows PE (Preinstallation Environment), hence I cannot use ExtractTemporaryFile() function to forcefully extract the DLL because the {tmp} path is not valid in that environment. That leaves me with only one option is to check after [Files] section is done. Please advise!

1

1 Answers

2
votes

Your constraint on not using ExtractTemporaryFile does not make sense.

The Inno Setup installer always creates a temporary folder for the installation.

2015-07-31 09:02:07.458 Created temporary directory: C:\Users\martin\AppData\Local\Temp\is-1CN29.tmp

If it is not possible to create the folder, the installation fails.

The Inno Setup tries to create the temporary folder in these locations:

  • %TMP%
  • %TEMP%
  • %USERPROFILE%
  • Windows installation folder (C:\Windows)

At least the last path has to exist even in the "Windows PE".

So I do not think, there's anything preventing you from using the ExtractTemporaryFile function.