From 1fa16772044e74db8fdf006a85973a87f302480d Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Thu, 29 Jun 2017 19:57:42 +0000 Subject: [PATCH] Register default mods during installation on Windows. --- packaging/windows/OpenRA.nsi | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packaging/windows/OpenRA.nsi b/packaging/windows/OpenRA.nsi index d563d439d6..f1177df3c9 100644 --- a/packaging/windows/OpenRA.nsi +++ b/packaging/windows/OpenRA.nsi @@ -150,6 +150,16 @@ Section "Game" GAME ${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2 IntFmt $0 "0x%08X" $0 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenRA${SUFFIX}" "EstimatedSize" "$0" + + SetShellVarContext all + CreateDirectory "$APPDATA\OpenRA\ModMetadata" + nsExec::ExecToLog '"$INSTDIR\OpenRA.Utility.exe" ra --register-mod "$INSTDIR\RedAlert.exe" system' + nsExec::ExecToLog '"$INSTDIR\OpenRA.Utility.exe" ra --clear-invalid-mod-registrations system' + nsExec::ExecToLog '"$INSTDIR\OpenRA.Utility.exe" cnc --register-mod "$INSTDIR\TiberianDawn.exe" system' + nsExec::ExecToLog '"$INSTDIR\OpenRA.Utility.exe" cnc --clear-invalid-mod-registrations system' + nsExec::ExecToLog '"$INSTDIR\OpenRA.Utility.exe" d2k --register-mod "$INSTDIR\Dune2000.exe" system' + nsExec::ExecToLog '"$INSTDIR\OpenRA.Utility.exe" d2k --clear-invalid-mod-registrations system' + SectionEnd Section "Desktop Shortcut" DESKTOPSHORTCUT @@ -200,6 +210,10 @@ SectionEnd !macro Clean UN Function ${UN}Clean + nsExec::ExecToLog '"$INSTDIR\OpenRA.Utility.exe" ra --unregister-mod system' + nsExec::ExecToLog '"$INSTDIR\OpenRA.Utility.exe" cnc --unregister-mod system' + nsExec::ExecToLog '"$INSTDIR\OpenRA.Utility.exe" d2k --unregister-mod system' + RMDir /r $INSTDIR\mods RMDir /r $INSTDIR\maps RMDir /r $INSTDIR\glsl