hsc
Posts: 101
Joined: Wed Mar 02, 2016 2:55 pm

Command line question: UpdatePrerequisite

Hi, what is wrong with this command line?

Code: Select all

"C:\Program Files (x86)\Caphyon\Advanced Installer 22.2\bin\x86\advinst.exe" /edit C:\Src\hsc\BCS\BCS_Setup.aip /UpdatePrerequisite "Visual C++ Redistributable for Visual Studio 2015-2022 x86" -minversion 14.42.34433
When I launch it, a window pops up with the command line syntax.

Thanks
Hans
hsc
Posts: 101
Joined: Wed Mar 02, 2016 2:55 pm

Re: Command line question: UpdatePrerequisite

Update: The problem with the command line was the missing "-prereq_path" option. This is a mandatory option, well hidden among lots of optional options. Now, the command line is:

Code: Select all

"C:\Program Files (x86)\Caphyon\Advanced Installer 22.2\bin\x86\advinst.exe" /edit C:\Src\hsc\BCS\BCS_Setup.aip ^
/UpdatePrerequisite "Visual C++ Redistributable for Visual Studio 2015-2022 x86" ^
-minversion "14.42.34433" ^
-prereq_path "C:\Src\hsc\BCS\Prerequisites\Visual_C++_Redistributable_for_Visual_Studio_2015-2022\VC_redist.x86.exe"
However, even though advinst.exe now runs without error messages, and finishes with exit code 0, the minimum version remains unchanged.

When I compare the aip file before and after running this command line, the only difference in the <ROW PrereqKey="..." ...> line is that the TargetName was changed from "Visual C++ Redistributable for Visual Studio 2015-2022\VC_redist.x86.exe" to "VC_redist.x86.exe". Whatever that may mean.

Bonus question: Can I use the "-search_path <search_path>" option to define the required minimum version? If so, how do I combine these command line options?
Catalin
Posts: 7492
Joined: Wed Jun 13, 2018 7:49 am

Re: Command line question: UpdatePrerequisite

Hello Hans,

Despite the value not being updated in the AIP file structure, could you please confirm that the value is updated when you open your project using the GUI app?

As far as I'm aware, we've noticed a little bug regarding exactly what you mentioned, but from our tests so far, this does not affect the behavior at all.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
hsc
Posts: 101
Joined: Wed Mar 02, 2016 2:55 pm

Re: Command line question: UpdatePrerequisite

Hello Catalin,

thank you for your reply. I re-checked and found the version number unchanged. I am attaching two screenshots so that you can verify I was looking in the right place. My intention was to change the minimum required version from 14.38.33135 to 14.42.34433.
2024-12-17_15h46_44.png
2024-12-17_15h46_44.png (84.87 KiB) Viewed 9313 times
2024-12-17_15h46_17.png
2024-12-17_15h46_17.png (86.01 KiB) Viewed 9313 times
Best
Hans
hsc
Posts: 101
Joined: Wed Mar 02, 2016 2:55 pm

Re: Command line question: UpdatePrerequisite

Using AI version 22.2. I can update to 22.3 if you think it fixes the problem.
Catalin
Posts: 7492
Joined: Wed Jun 13, 2018 7:49 am

Re: Command line question: UpdatePrerequisite

Hello Hans,

First of all, please accept my apologies for the quite delayed reply on this.

I have run some tests and I can indeed confirm the behavior - using the latest version of AI as well.

Unfortunately, I can not say for sure why this is happening nor was I able to find a workaround.

For now, I will open a ticket so that the dev team can further investigate this.

I'll update this thread once I'll have more details.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Catalin
Posts: 7492
Joined: Wed Jun 13, 2018 7:49 am

Re: Command line question: UpdatePrerequisite

Hello Hans,

Upon further investigation, it looks like we also need to specify the registry search for which we want to update the min version.

Here is an example cmdline:

Code: Select all

AdvancedInstaller.com /edit "C:\\Users\\Catalin\\Desktop\\Your Application.aip" /UpdatePrerequisite "Visual C++ Redistributable for Visual Studio 2015-2022 x86" -minversion "14.42.34433" -prereq_path "C:\\Users\\Catalin\\Documents\\Advanced Installer\\Projects\\Your Application\\Prerequisites\\Visual C++ Redistributable for Visual Studio 2015-2022\\VC_redist.x86.exe" -search_path "HKLM\SOFTWARE\Microsoft\DevDiv\VC\Servicing\14.0\RuntimeMinimum\Version"
Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
hsc
Posts: 101
Joined: Wed Mar 02, 2016 2:55 pm

Re: Command line question: UpdatePrerequisite

Hello Catalin, happy new year, and thank you for your reply! Your suggested command line works, but now I am a little confused. As you can see from this screenshot, it added a third install condition. The top two conditions, with value 14.38.33135, were present before I applied the command.
2025-01-07_09h43_18.png
2025-01-07_09h43_18.png (81.36 KiB) Viewed 8072 times
I wonder, should I delete the second condition, and maybe the first condition too?

Thanks
Hans
hsc
Posts: 101
Joined: Wed Mar 02, 2016 2:55 pm

Re: Command line question: UpdatePrerequisite

I found a solution. I am posting this here for reference. Or maybe someone finds a more elegant way...

Since the prerequisite has two conditions (I don't know why, but this is how AI created it), I issue two UpdatePrerequisite commands, one for each condition. (See screenshot in my previous comment.)

The command to update the "Registry value contains version" is:

Code: Select all

advinst.exe /edit "my_project.aip" /UpdatePrerequisite "Visual C++ Redistributable for Visual Studio 2015-2022 x86" ^
-minversion "14.42.34433" -prereq_path "<path>\VC_redist.x86.exe" ^
-search_type RegValue -search_path "HKLM\SOFTWARE\Microsoft\DevDiv\VC\Servicing\14.0\RuntimeMinimum\Version"
(The carets "^" at the end of line are line continuation markers which I inserted for readability.)
The important difference to Catalin's suggestion is that I uppercased the "VC" registry key component. Case and spelling must exactly match the value stored in the *.aip file.

The other command updates the "File Version" condition:

Code: Select all

advinst.exe /edit "my_projct.aip" /UpdatePrerequisite "Visual C++ Redistributable for Visual Studio 2015-2022 x86" ^
-minversion "14.42.34433" -prereq_path "<path>\VC_redist.x86.exe" ^
-search_type FileVersion -search_path "[SystemFolder]vcruntime140.dll"
That's it!

Hans
Catalin
Posts: 7492
Joined: Wed Jun 13, 2018 7:49 am

Re: Command line question: UpdatePrerequisite

Hello Hans,

Thank you very much for sharing your solution with us - I'm sure this will be of help for further users facing a similar scenario. :)

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”