Skip to content

Commit

Permalink
remove installation of .NET and VS runtimes as dependency of proteowi…
Browse files Browse the repository at this point in the history
…zard (msconvert): the current pwiz ships all vc-runtimes in its ./bin folder and requires a .NET runtime which is by default installed on every Win10 anyway (see https://learn.microsoft.com/en-us/archive/blogs/astebner/mailbag-what-version-of-the-net-framework-is-included-in-what-version-of-the-os)
  • Loading branch information
cbielow committed Nov 16, 2023
1 parent 415b5bd commit b80b72a
Showing 1 changed file with 12 additions and 121 deletions.
133 changes: 12 additions & 121 deletions cmake/Windows/NSIS.template.in
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,6 @@ SetCompressor /SOLID lzma
### SCRIPT ###
##################

# pwiz needs alternative VS runtime libraries (32bit for Agilent libraries)
!define VS_PWIZ_REDISTRIBUTABLE_EXE "vcredist2010_x86_sp1.exe"

# additional pwiz redistributables
!define VS_PWIZ_ADD1_REDISTRIBUTABLE_EXE "vcredist2012_x64_upd4.exe"
!define VS_PWIZ_ADD2_REDISTRIBUTABLE_EXE "vcredist2013_x64_upd2.exe"

# which extensions to connect to TOPPView and TOPPAS
!macro OpenMSGUIExtensions _action
!insertmacro ${_action} ".mzData" "TOPPView"
Expand Down Expand Up @@ -79,7 +72,7 @@ SetCompressor /SOLID lzma
# We could also define the following
#CONTACT
#URL_HELP_LINK

# MultiUser defines
!define MULTIUSER_INSTALLMODE_INSTDIR "${PRODUCT_NAME}-${VERSION}" # Otherwise it would just be PRODUCT_NAME
Expand Down Expand Up @@ -314,7 +307,7 @@ Section "Documentation" SEC_Doc
# open uninstall log file
!insertmacro UNINSTALL.LOG_OPEN_INSTALL

# html docs
# html docs
!if ${DEBUG_SKIP_DOCU} == 0

File /r "${OPENMSDOCDIR}\html\*.*"
Expand All @@ -327,97 +320,15 @@ SectionEnd
## Third party libs
## TODO switch to packagedir
SectionGroup "ThirdParty" SEC_ThirdParty
!if ${DEBUG_NO_THIRDPARTY} == 0
Section "Proteowizard" SEC_pwiz
SectionIn 1 3
!if ${DEBUG_NO_THIRDPARTY} == 0
Section "Proteowizard" SEC_pwiz
SectionIn 1 3
SetOverwrite on
CreateDirectory "$INSTDIR\share\OpenMS\THIRDPARTY\pwiz-bin"
SetOutPath "$INSTDIR\share\OpenMS\THIRDPARTY\pwiz-bin"
!insertmacro UNINSTALL.LOG_OPEN_INSTALL

File /r "${THIRDPARTYDIR}\pwiz-bin\*.*"

!insertmacro UNINSTALL.LOG_CLOSE_INSTALL
SectionEnd

Section ".NET and VSRuntime for Proteowizard" SEC_dotnet
SectionIn 1 3
SetOverwrite on
!insertmacro UNINSTALL.LOG_OPEN_INSTALL

Var /GLOBAL netSilentArgs
StrCpy $netSilentArgs ""
IfSilent 0 +2
StrCpy $netSilentArgs "/q /norestart"

## download .NET 3.5 and 4.0 (required by pwiz)

inetc::get /BANNER "Getting .NET 3.5 SP1 installer." \
"http://www.microsoft.com/downloads/info.aspx?na=41&SrcFamilyId=AB99342F-5D1A-413D-8319-81DA479AB0D7&SrcDisplayLang=en&u=http%3a%2f%2fdownload.microsoft.com%2fdownload%2f0%2f6%2f1%2f061F001C-8752-4600-A198-53214C69B51F%2fdotnetfx35setup.exe" \
"$EXEDIR\NET3.5_SP1_installer.exe"
Pop $0
StrCmp $0 "OK" dl35ok net35_install_success
MessageBox MB_OK|MB_ICONEXCLAMATION "Downloading 'Microsoft .NET 3.5 SP1' failed. You must download and install it manually in order for Proteowizard to work!" /SD IDOK

dl35ok:
ClearErrors
ExecWait '"$EXEDIR\NET3.5_SP1_installer.exe" $netSilentArgs' $0
StrCmp $0 0 net35_install_success
MessageBox MB_OK|MB_ICONEXCLAMATION "The installation of the Microsoft .NET 3.5 SP1' package failed! You must download and install it manually in order for Proteowizard to work!" /SD IDOK

net35_install_success:
## .NET 3.5 installed, yeah!

inetc::get /BANNER "Getting .NET 4.0 installer." \
"http://www.microsoft.com/downloads/info.aspx?na=41&SrcFamilyId=AB99342F-5D1A-413D-8319-81DA479AB0D7&SrcDisplayLang=en&u=http%3a%2f%2fdownload.microsoft.com%2fdownload%2f9%2f5%2fA%2f95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE%2fdotNetFx40_Full_x86_x64.exe" \
"$EXEDIR\NET4.0_installer.exe"

Pop $0
StrCmp $0 "OK" dl40ok net40_install_success
MessageBox MB_OK|MB_ICONEXCLAMATION "Downloading 'Microsoft .NET 4.0' failed. You must download and install it manually in order for Proteowizard to work!" /SD IDOK

dl40ok:
ClearErrors
ExecWait '"$EXEDIR\NET4.0_installer.exe" $netSilentArgs' $0
StrCmp $0 0 net40_install_success
MessageBox MB_OK|MB_ICONEXCLAMATION "The installation of the Microsoft .NET 4.0' package failed! You must download and install it manually in order for Proteowizard to work!" /SD IDOK

net40_install_success:
## .NET 4.0 installed, yeah!

## pwiz now requires vs 2010 32bit (!) runtime libraries installed (Agilent libraries)
## 2017: now also 2012 and 2013 of the corresponding platform
SetOutPath $TEMP
SetOverwrite on

File "${THIRDPARTYDIR}\${VS_PWIZ_REDISTRIBUTABLE_EXE}"
ClearErrors
ExecWait '$TEMP\${VS_PWIZ_REDISTRIBUTABLE_EXE} /passive /norestart' $0
StrCmp $0 0 vs_pwiz_install_success
StrCmp $0 1638 vs_pwiz_install_success
MessageBox MB_OK "The installation of the Visual Studio redistributable package '${VS_PWIZ_REDISTRIBUTABLE_EXE}' failed! Proteowizard will not work unless this package is installed! The package is located at '$TEMP\${VS_PWIZ_REDISTRIBUTABLE_EXE}'. Try to execute it as administrator - there will likely be an error which you can blame Microsoft for. If you cannot fix it contact the OpenMS developers!"

vs_pwiz_install_success:

File "${THIRDPARTYDIR}\${VS_PWIZ_ADD1_REDISTRIBUTABLE_EXE}"
ClearErrors
ExecWait '$TEMP\${VS_PWIZ_ADD1_REDISTRIBUTABLE_EXE} /passive /norestart' $0
StrCmp $0 0 vs_pwiz_add1_install_success
StrCmp $0 1638 vs_pwiz_add1_install_success
MessageBox MB_OK "The installation of the Visual Studio redistributable package '${VS_PWIZ_ADD1_REDISTRIBUTABLE_EXE}' failed! Proteowizard will not work unless this package is installed! The package is located at '$TEMP\${VS_PWIZ_ADD1_REDISTRIBUTABLE_EXE}'. Try to execute it as administrator - there will likely be an error which you can blame Microsoft for. If you cannot fix it contact the OpenMS developers!"

vs_pwiz_add1_install_success:

File "${THIRDPARTYDIR}\${VS_PWIZ_ADD2_REDISTRIBUTABLE_EXE}"
ClearErrors
ExecWait '$TEMP\${VS_PWIZ_ADD2_REDISTRIBUTABLE_EXE} /install /passive /norestart' $0
StrCmp $0 0 vs_pwiz_add2_install_success
StrCmp $0 1638 vs_pwiz_add2_install_success
MessageBox MB_OK "The installation of the Visual Studio redistributable package '${VS_PWIZ_ADD2_REDISTRIBUTABLE_EXE}' failed! Proteowizard will not work unless this package is installed! The package is located at '$TEMP\${VS_PWIZ_ADD2_REDISTRIBUTABLE_EXE}'. Try to execute it as administrator - there will likely be an error which you can blame Microsoft for. If you cannot fix it contact the OpenMS developers!"

## reasons why the install might fail:

vs_pwiz_add2_install_success:
File /r "${THIRDPARTYDIR}\pwiz-bin\*.*"

!insertmacro UNINSTALL.LOG_CLOSE_INSTALL
SectionEnd
Expand All @@ -427,8 +338,7 @@ SectionGroup "ThirdParty" SEC_ThirdParty
!system 'FOR /D %A IN ("${THIRDPARTYDIR}\*") DO @( IF NOT "%~nA" == "pwiz-bin" ((echo Section "%~nA" & echo SectionIn 1 3 & echo !insertmacro UNINSTALL.LOG_OPEN_INSTALL & echo SetOverwrite on & echo CreateDirectory "$INSTDIR\share\OpenMS\THIRDPARTY\%~nA" & echo SetOutPath "$INSTDIR\share\OpenMS\THIRDPARTY\%~nA" & echo File /r "%~A\*.*" & echo Var /GLOBAL %~nAInstalled & echo StrCpy $%~nAInstalled "1" & echo !insertmacro UNINSTALL.LOG_CLOSE_INSTALL & echo SectionEnd) >> "${filelist}"))'
!include "${filelist}"
!delfile "${filelist}"

!endif
!endif

SectionGroupEnd

Expand All @@ -447,8 +357,8 @@ SectionEnd
Function CreateShortcuts
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application

## warning: create shortcuts only AFTER installing files, OR renew SetOutPath
## otherwise all files will be installed to the default install directory
## warning: create shortcuts only AFTER installing files, OR renew SetOutPath
## otherwise all files will be installed to the default install directory
!insertmacro CREATE_SMGROUP_SHORTCUT "OpenMS Documentation (html)" $INSTDIR\share\doc\html\index.html

!insertmacro CREATE_SMGROUP_SHORTCUT TOPPView $INSTDIR\bin\TOPPView.exe
Expand Down Expand Up @@ -592,31 +502,16 @@ SectionEnd

# hidden section, write install size as the final step
Section "-Write Install Size"
!insertmacro MULTIUSER_RegistryAddInstallSizeInfo
!insertmacro MULTIUSER_RegistryAddInstallSizeInfo
SectionEnd

Function parseParameters

ClearErrors

; /nothirdparty
${GetOptions} $cmdLineParams '/nothirdparty' $R0
IfErrors nopwiz 0
IfErrors parsedParams 0
!insertmacro ClearSectionFlag ${SEC_ThirdParty} ${SF_SELECTED}
goto parsedParams

; /nopwiz
nopwiz:
${GetOptions} $cmdLineParams '/nopwiz' $R0
IfErrors nodotnet 0
!insertmacro ClearSectionFlag ${SEC_pwiz} ${SF_SELECTED}
goto parsedParams

; /nodotnet
nodotnet:
${GetOptions} $cmdLineParams '/nodotnet' $R0
IfErrors parsedParams 0
!insertmacro ClearSectionFlag ${SEC_dotnet} ${SF_SELECTED}

parsedParams:

Expand Down Expand Up @@ -646,8 +541,6 @@ Function .onInit
/currentuser$\t- (un)install for current user only, case-insensitive$\r$\n\
/uninstall$\t- (installer only) run uninstaller, requires /allusers or /currentuser, case-insensitive$\r$\n\
/nothirdparty$\t- does not install thirdparty tools, case-sensitive$\r$\n\
/nopwiz$\t- does not install proteowizard, case-sensitive$\r$\n\
/nodotnet$\t- does not try to install dotnet framework, case-sensitive$\r$\n\
/S$\t- silent mode, requires /allusers or /currentuser, case-sensitive$\r$\n\
/D$\t- (installer only) set install directory, must be last parameter, without quotes, case-sensitive$\r$\n\
/?$\t- display this message$\r$\n\
Expand Down Expand Up @@ -759,9 +652,7 @@ FunctionEnd
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_TOPP} "TOPP (The OpenMS PiPeline) - chainable tools for data analysis"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_Doc} "Documentation/Tutorials for TOPP, TOPPView and the OpenMS library itself."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_ThirdParty} "Install third party libraries (e.g., ProteoWizard)."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_dotnet} "Install .NET and Microsoft Visual Studio Runtime for Proteowizard. (may require the installer to be run in admin mode). Deactivate if you are not admin and think this is installed already (or will be installed later) by an admin."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_RegisterExt} "Register certain file types (e.g., '.mzML') with TOPPView.exe."
#!insertmacro MUI_DESCRIPTION_TEXT ${SEC_VSRuntime} "Install the required Microsoft Visual Studio runtime (may require the installer to be run in admin mode). Deactivate if you are not admin and think this is installed already (or will be installed later) by an admin."
!insertmacro MUI_FUNCTION_DESCRIPTION_END

################
Expand Down Expand Up @@ -813,7 +704,7 @@ Section "-Uninstall"
${un.RefreshShellIcons}

## delete all installed files
!insertmacro UNINSTALL.NEW_UNINSTALL
!insertmacro UNINSTALL.NEW_UNINSTALL

# remove directories which are now empty (in case some were forgotten)
Push "$INSTDIR"
Expand Down

0 comments on commit b80b72a

Please sign in to comment.