add vc_redist as a NSIS install section

Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
Rachel Powers 2024-09-27 00:18:35 -07:00
parent b9a6c13d47
commit 2dc6f7504b
No known key found for this signature in database
GPG Key ID: E10E321EB160949B
2 changed files with 17 additions and 0 deletions

View File

@ -41,6 +41,21 @@ configure_file(org.prismlauncher.PrismLauncher.metainfo.xml.in org.prismlauncher
configure_file(prismlauncher.rc.in prismlauncher.rc @ONLY)
configure_file(prismlauncher.manifest.in prismlauncher.manifest @ONLY)
configure_file(prismlauncher.ico prismlauncher.ico COPYONLY)
if(MSVC)
set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION vc_redist)
include(InstallRequiredSystemLibraries)
file(TO_NATIVE_PATH ${MSVC_REDIST_DIR} Native_MSVC_REDIST_DIR)
set(Launcher_MSVC_Redist_NSIS_Section "\
Section \"Visual Studio Runtime\"
SetOutPath \"$INSTDIR\\vc_redist\"
File \"${Native_MSVC_REDIST_DIR}\\vc_redist.x64.exe\"
ExecWait \"$INSTDIR\\vc_redist\\vc_redist.x64.exe /install /passive\"
; Delete \"$INSTDIR\\vc_redist\\vc_redist.x64.exe\"
SectionEnd\
")
endif()
configure_file(win_install.nsi.in win_install.nsi @ONLY)
if(SCDOC_FOUND)

View File

@ -396,6 +396,8 @@ Section "@Launcher_DisplayName@"
SectionEnd
@Launcher_MSVC_Redist_NSIS_Section@
Section "Start Menu Shortcut" SM_SHORTCUTS
CreateShortcut "$SMPROGRAMS\@Launcher_DisplayName@.lnk" "$INSTDIR\@Launcher_APP_BINARY_NAME@.exe" "" "$INSTDIR\@Launcher_APP_BINARY_NAME@.exe" 0