dybalabj
Posts: 58
Joined: Thu Jan 09, 2014 2:00 am

Prerequisite install condition not executing (Vista SP2)

I am trying to install a Windows Update as a prerequisite on Windows Vista SP2 (my client has some customers he wants to support that are still running Vista). My install conditions for the prerequisite are:
- Windows Vista Service Pack 2 (x86)
- result of C:\Windows\System32\cmd.exe /c "wmic qfe get hotfixid | findstr ^"KB971512^"" is FALSE (empty string)
- Install prerequisite if all conditions are false

This works fine if I build the installer in Vista SP2 (x86) - I see the command prompt display when checking if the update is already installed. However, if I build the installer under Windows 7 SP1 (x64), the OS condition works but the Windows Update check does not execute (I do not see the command prompt window display), and it tries to install the update anyway. I have also tried building the installer with Advanced Installer 12.3.1 in Windows 7, with the same result (12.3.1 no longer supports Vista, so I don't know if building the installer there would still work or not).

This is a problem for me because I need to prompt the user to restart the PC after the update before continuing the install. Because the prerequiste check keeps thinking the update is needed, it gets stuck trying to reboot after installing the update (if I set my AIP to prompt for a reboot after install). I can set the AIP to not reboot, and let the update itself take care of the reboot, but this means the user doesn't get a prompt. If AIP is set to reboot "only if installed successfully", then I don't get a reboot prompt, even though I know the install worked. If I set the AIP to always reboot, then i get stuck in the reboot loop because it keeps trying to install the update.

I've attached a simple AIP to reproduce the problem.
Vista check for Win Update.zip
(4.29 KiB) Downloaded 522 times
Any help would be appreciated.

- Brandon
Last edited by dybalabj on Wed Oct 12, 2016 5:08 pm, edited 1 time in total.
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Prerequisite install condition not executing

Hi Brandon,

I have tested your scenario and it worked as expected. On a Windows Vista SP2 machine, the install conditions was true, so I was not prompted to install the prerequisite.

Then, I've tried to run the installation package on a Windows Vista (no SP). The result of the search operation from the install condition of the prerequisite was false (the prerequisite should be installed based its install condition). However, it did not get installed due to the Supported OS condition. Once I have added the Windows Vista to the supported list and rebuild the installation package (for debuging purposes) I was prompted to install the windows update prerequisite.

On a Windows 8.1 and Windows 7 machine, othough the install condition for the prerequisite was false( the prerequisite should be installed based its install condition) it was never launched for installation. which is correct since it only support Windows Vista. The windows 7 and 8.1 are not on the supported list.

Can you please try to test this once again?

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dybalabj
Posts: 58
Joined: Thu Jan 09, 2014 2:00 am

Re: Prerequisite install condition not executing (Vista SP2)

Dan,

I can still reproduce the problem. Can you confirm if you built the install on Windows 7 or Windows Vista? If I build the installer on Vista, then everything works properly. If I build the installer on Windows 7 (have not tried 8 or 10) then try to install on Vista SP2, then I experience the problems I described (when Supported OS condition is true, the Install Condition does not appear to execute).

I did confirm that is the prerequisite is already installed before I run my installer, then it still tries to install the prerequisite (again only if I build the installer on Windows 7)

Thanks,

Brandon
Last edited by dybalabj on Wed Oct 12, 2016 5:09 pm, edited 1 time in total.
dybalabj
Posts: 58
Joined: Thu Jan 09, 2014 2:00 am

Re: Prerequisite install condition not executing (Vista SP2)

I realize I'm resurrecting an old thread, but I was never able to get this problem resolved. I've installed the latest AI 13.2.1 Release Candidate and confirmed that when I try to install the Vista Platform Update (KB971512) on Vista SP2, my install condition still appears to be ignored. If I reboot after installing the update (but starting my main installer), then the update attempts to install again, even though the condition should be true.

The .aip file and resulting installer are both in the attached zip file. The installer was built using Windows 7 Professional SP1 64-bit. Previous tests using the latest AI supported by Vista indicating that building the installer on Vista worked, but building it on Windows 7 did not.

If you can reproduce the problem using the attached files, I'd appreciate any feedback. I realize Vista is not widely used, but I do have some users that still have not upgraded.

Thanks,

Brandon
Attachments
Vista Platform Update AI test - condition ignored.zip
(731.25 KiB) Downloaded 475 times
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Prerequisite install condition not executing (Vista SP2)

Hello Brandon,

Please accept my apologizes for the delayed reply.

I've tested and replicated the behavior. This happens because you are using the cmd.exe tool to perform the "Search done by a custom executable" of your prerequisite.

Please note that when building the setup project on Windows 7 machine, there will be the cmd.exe from the Windows 7 build machine that will be bundled in the setup package. Therefore at install time when the cmd.exe (bundled in the EXE setup) is launched, it is always failing because the Windows 7's cmd.exe is not compatible to be run on Windows Vista or earlier OS versions. So, in this case the install condition of your prerequisite will be always FALSE (the launched cmd.exe has a different exit code than 0).

As a workaround for your scenario, you can add a copy of the Vista's cmd.exe on your Windows 7 build machine and configure your prerequisite's "Search done by a custom executable" search to use the copy of the Vista's cmd.exe.

Let us know if this worked.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dybalabj
Posts: 58
Joined: Thu Jan 09, 2014 2:00 am

Re: Prerequisite install condition not executing (Vista SP2)

Daniel,

Thanks for the response. For some reason I was thinking this would be executing cmd.exe from C:\Windows\System32 on the user's system rather than bundling cmd.exe with the installer. Your explanation makes a lot more sense.

Is there a way I can execute a bat file or command line install condition that will use the version of cmd.exe already on the user's system (if not, this might be a nice feature to include in a future update)? Or is my best option to include the Vista cmd.exe as you described?

Thanks,

Brandon
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Prerequisite install condition not executing (Vista SP2)

You're always welcome Brandon,

I'm not sure if this will work too, but you can create a BAT file containing the command you want to run, and use it instead of the cmd.exe file you launch using the "Search done by a custom executable" option. Also, when picking the BAT file in the browser window please set the file type filter to "All files" so you could pick a BAT file. However, I didn't test this solution, so please thoroughly test it to make sure it is a working one too.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”