VC++ Redist install passively without restart always restarting

1.2k Views Asked by At

I'm trying to install VC++ Redist without any user input using the following code. I do not want system restart as well – so supplied /norestart flag

https://learn.microsoft.com/en-us/cpp/windows/redistributing-visual-cpp-files#command-line-options-for-the-redistributable-packages

[Run]
Filename: "{tmp}\VC_redist.x64.exe"; \
    Parameters: "/passive /Q:a /c:""msiexec /qb /norestart /i vcredist.msi"" "; \
    StatusMsg: Installing VC++ RunTime...

But after the install, the setup tries to restart the machine automatically

1

There are 1 best solutions below

1
Martin Prikryl On BEST ANSWER

The VC++ Redist probably schedules some files to be replaced after next restart. Inno Setup detects that and restarts the computer after it finishes.

You can disable Inno Setup from detecting this using RestartIfNeededByRun directive:

When set to yes, and a program executed in the [Run] section queues files to be replaced on the next reboot (by calling MoveFileEx or by modifying wininit.ini), Setup will detect this and prompt the user to restart the computer at the end of installation.