sonic-pi-net / sonic-pi

Code. Music. Live.
https://sonic-pi.net
Other
10.78k stars 922 forks source link

Use proper method to install C++ redistributables and CRT package #3046

Open TomaszTheTomasz opened 2 years ago

TomaszTheTomasz commented 2 years ago

Hi,

During installation of Sonic PI I got prompted to turn off Logitech update service, which seemed a bit odd. Upon inspecting the .msi used for installation of Sonic Pi, I have encountered C Runtime libraries as well as vcruntime library which is part of C++ redistributables. It seems their destination is system64 directory and that's very incorrect way to install those libraries.

If you want to deploy them with Sonic Pi you should follow these guidelines: https://docs.microsoft.com/en-us/cpp/windows/choosing-a-deployment-method?view=msvc-170#redistributable-visual-c-libraries

And in short, the recommended option is to run the installer of Visual C++ Redistributable package.

Reasoning here is that with current approach people running this installer will have their version of redistributables overwritten by the one included in the installer. Since the libraries in the installer might eventually become outdated, then overwriting newer version might potentially break some other applications for the user. Installer provided by Microsoft performs verification of whether installation is actually needed, as well as installs other required Windows updates.

samaaron commented 2 years ago

Hi @TomaszTheTomasz, thanks for the feedback.

Our current Windows msi build process uses WiX and you can find the various scripts that make this happen here:

https://github.com/sonic-pi-net/sonic-pi/tree/dev/install/windows

We added the Visual C++ Redistributable package via a "merge module" a couple of years ago to enable Sonic Pi to run on older versions of Windows.

However, we're always looking to improve what we have, so if you're interested in helping out it would be great to hear how you propose we change this current process :-)

TomaszTheTomasz commented 2 years ago

Thanks for the answer. I think the recommended way to distribute Visual Studio C++ libraries by the Microsoft is to use installation package, as they mention that using merge modules is deprecated in this case. You can download from here: https://docs.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist?view=msvc-170#visual-studio-2015-2017-2019-and-2022

I am not familiar with WiX, but it seems you can include the package as a Fragment element, based on following examples: https://sourceforge.net/p/wix/mailman/message/29737862/ https://stackoverflow.com/a/35889484