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:
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?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!