Create separate Windows launchers for each mod.

This commit is contained in:
Paul Chote
2017-04-15 14:48:32 +00:00
parent b5523d6b3f
commit 3e0f055a3c
8 changed files with 75 additions and 28 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

View File

@@ -56,17 +56,28 @@ Section "-Reg" Reg
; Installation directory
WriteRegStr HKLM "Software\OpenRA" "InstallDir" $INSTDIR
; OpenRA URL Scheme
WriteRegStr HKLM "Software\Classes\openra" "" "URL:OpenRA scheme"
WriteRegStr HKLM "Software\Classes\openra" "URL Protocol" ""
WriteRegStr HKLM "Software\Classes\openra\DefaultIcon" "" "$INSTDIR\OpenRA.ico,0"
WriteRegStr HKLM "Software\Classes\openra\Shell\Open\Command" "" "$INSTDIR\OpenRA.exe Launch.URI=%1"
; Join server URL Scheme
WriteRegStr HKLM "Software\Classes\openra-ra-${TAG}" "" "URL:Join OpenRA server"
WriteRegStr HKLM "Software\Classes\openra-ra-${TAG}" "URL Protocol" ""
WriteRegStr HKLM "Software\Classes\openra-ra-${TAG}\DefaultIcon" "" "$INSTDIR\RedAlert.ico,0"
WriteRegStr HKLM "Software\Classes\openra-ra-${TAG}\Shell\Open\Command" "" "$INSTDIR\RedAlert.exe Launch.URI=%1"
WriteRegStr HKLM "Software\Classes\openra-cnc-${TAG}" "" "URL:Join OpenRA server"
WriteRegStr HKLM "Software\Classes\openra-cnc-${TAG}" "URL Protocol" ""
WriteRegStr HKLM "Software\Classes\openra-cnc-${TAG}\DefaultIcon" "" "$INSTDIR\TiberianDawn.ico,0"
WriteRegStr HKLM "Software\Classes\openra-cnc-${TAG}\Shell\Open\Command" "" "$INSTDIR\TiberianDawn.exe Launch.URI=%1"
WriteRegStr HKLM "Software\Classes\openra-d2k-${TAG}" "" "URL:Join OpenRA server"
WriteRegStr HKLM "Software\Classes\openra-d2k-${TAG}" "URL Protocol" ""
WriteRegStr HKLM "Software\Classes\openra-d2k-${TAG}\DefaultIcon" "" "$INSTDIR\Dune2000.ico,0"
WriteRegStr HKLM "Software\Classes\openra-d2k-${TAG}\Shell\Open\Command" "" "$INSTDIR\Dune2000.exe Launch.URI=%1"
; Remove obsolete file associations
DeleteRegKey HKLM "Software\Classes\.orarep"
DeleteRegKey HKLM "Software\Classes\OpenRA_replay"
DeleteRegKey HKLM "Software\Classes\.oramod"
DeleteRegKey HKLM "Software\Classes\OpenRA_mod"
DeleteRegKey HKLM "Software\Classes\openra"
SectionEnd
@@ -82,7 +93,9 @@ Section "Game" GAME
File /r "${SRCDIR}\mods\modcontent"
SetOutPath "$INSTDIR"
File "${SRCDIR}\OpenRA.exe"
File "${SRCDIR}\RedAlert.exe"
File "${SRCDIR}\TiberianDawn.exe"
File "${SRCDIR}\Dune2000.exe"
File "${SRCDIR}\OpenRA.Game.exe"
File "${SRCDIR}\OpenRA.Game.exe.config"
File "${SRCDIR}\OpenRA.Utility.exe"
@@ -98,6 +111,9 @@ Section "Game" GAME
File "${SRCDIR}\CONTRIBUTING.html"
File "${SRCDIR}\DOCUMENTATION.html"
File "${SRCDIR}\OpenRA.ico"
File "${SRCDIR}\RedAlert.ico"
File "${SRCDIR}\TiberianDawn.ico"
File "${SRCDIR}\Dune2000.ico"
File "${SRCDIR}\SharpFont.dll"
File "${SRCDIR}\SDL2-CS.dll"
File "${SRCDIR}\OpenAL-CS.dll"
@@ -113,8 +129,12 @@ Section "Game" GAME
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\OpenRA.lnk" $OUTDIR\OpenRA.exe "" \
"$OUTDIR\OpenRA.exe" "" "" "" ""
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Red Alert.lnk" $OUTDIR\RedAlert.exe "" \
"$OUTDIR\RedAlert.exe" "" "" "" ""
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Tiberian Dawn.lnk" $OUTDIR\TiberianDawn.exe "" \
"$OUTDIR\TiberianDawn.exe" "" "" "" ""
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Dune 2000.lnk" $OUTDIR\Dune2000.exe "" \
"$OUTDIR\Dune2000.exe" "" "" "" ""
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\README.lnk" $OUTDIR\README.html "" \
"$OUTDIR\README.html" "" "" "" ""
!insertmacro MUI_STARTMENU_WRITE_END
@@ -129,8 +149,12 @@ SectionEnd
Section "Desktop Shortcut" DESKTOPSHORTCUT
SetOutPath "$INSTDIR"
CreateShortCut "$DESKTOP\OpenRA.lnk" $INSTDIR\OpenRA.exe "" \
"$INSTDIR\OpenRA.exe" "" "" "" ""
CreateShortCut "$DESKTOP\OpenRA - Red Alert.lnk" $INSTDIR\RedAlert.exe "" \
"$INSTDIR\RedAlert.exe" "" "" "" ""
CreateShortCut "$DESKTOP\OpenRA - Tiberian Dawn.lnk" $INSTDIR\TiberianDawn.exe "" \
"$INSTDIR\TiberianDawn.exe" "" "" "" ""
CreateShortCut "$DESKTOP\OpenRA - Dune 2000.lnk" $INSTDIR\Dune2000.exe "" \
"$INSTDIR\Dune2000.exe" "" "" "" ""
SectionEnd
;***************************
@@ -177,7 +201,9 @@ Function ${UN}Clean
RMDir /r $INSTDIR\maps
RMDir /r $INSTDIR\glsl
RMDir /r $INSTDIR\lua
Delete $INSTDIR\OpenRA.exe
Delete $INSTDIR\RedAlert.exe
Delete $INSTDIR\TiberianDawn.exe
Delete $INSTDIR\Dune2000.exe
Delete $INSTDIR\OpenRA.Game.exe
Delete $INSTDIR\OpenRA.Game.exe.config
Delete $INSTDIR\OpenRA.Utility.exe
@@ -194,6 +220,9 @@ Function ${UN}Clean
Delete $INSTDIR\CONTRIBUTING.html
Delete $INSTDIR\DOCUMENTATION.html
Delete $INSTDIR\OpenRA.ico
Delete $INSTDIR\RedAlert.ico
Delete $INSTDIR\TiberianDawn.ico
Delete $INSTDIR\Dune2000.ico
Delete "$INSTDIR\global mix database.dat"
Delete $INSTDIR\MaxMind.Db.dll
Delete $INSTDIR\GeoLite2-Country.mmdb.gz
@@ -209,14 +238,18 @@ Function ${UN}Clean
RMDir /r $INSTDIR\Support
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenRA"
DeleteRegKey HKLM "Software\Classes\openra"
DeleteRegKey HKLM "Software\Classes\openra-ra-${TAG}"
DeleteRegKey HKLM "Software\Classes\openra-cnc-${TAG}"
DeleteRegKey HKLM "Software\Classes\openra-d2k-${TAG}"
Delete $INSTDIR\uninstaller.exe
RMDir $INSTDIR
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
RMDir /r "$SMPROGRAMS\$StartMenuFolder"
Delete $DESKTOP\OpenRA.lnk
Delete $DESKTOP\OpenRA - Red Alert.lnk
Delete $DESKTOP\OpenRA - Tiberian Dawn.lnk
Delete $DESKTOP\OpenRA - Dune 2000.lnk
DeleteRegKey HKLM "Software\OpenRA"
FunctionEnd
!macroend

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

22
packaging/windows/buildpackage.sh Executable file → Normal file
View File

@@ -8,6 +8,13 @@ OUTPUTDIR="$4"
LAUNCHER_LIBS="-r:System.dll -r:System.Drawing.dll -r:System.Windows.Forms.dll -r:${BUILTDIR}/OpenRA.Game.exe"
FAQ_URL="http://wiki.openra.net/FAQ"
SUFFIX=" (dev)"
if [[ $TAG == release* ]]; then
SUFFIX=""
elif [[ $TAG == playtest* ]]; then
SUFFIX=" (playtest)"
fi
function makelauncher()
{
sed "s|DISPLAY_NAME|$2|" WindowsLauncher.cs.in | sed "s|MOD_ID|$3|" | sed "s|FAQ_URL|${FAQ_URL}|" > WindowsLauncher.cs
@@ -16,12 +23,17 @@ function makelauncher()
mono ${SRCDIR}/fixheader.exe $1 > /dev/null
}
echo "Compiling Windows launcher"
makelauncher ${BUILTDIR}/OpenRA.exe "OpenRA" "" OpenRA.ico
echo "Compiling Windows launchers"
makelauncher ${BUILTDIR}/RedAlert.exe "Red Alert" "ra" RedAlert.ico
makelauncher ${BUILTDIR}/TiberianDawn.exe "Tiberian Dawn" "cnc" TiberianDawn.ico
makelauncher ${BUILTDIR}/Dune2000.exe "Dune 2000" "d2k" Dune2000.ico
# Windows specific icons
cp OpenRA.ico RedAlert.ico TiberianDawn.ico Dune2000.ico ${BUILTDIR}
if [ -x /usr/bin/makensis ]; then
echo "Building Windows setup.exe"
makensis -V2 -DSRCDIR="$BUILTDIR" -DDEPSDIR="${SRCDIR}/thirdparty/download/windows" OpenRA.nsi
makensis -V2 -DSRCDIR="$BUILTDIR" -DDEPSDIR="${SRCDIR}/thirdparty/download/windows" -DTAG="${TAG}" OpenRA.nsi
if [ $? -eq 0 ]; then
mv OpenRA.Setup.exe "$OUTPUTDIR"/OpenRA-$TAG.exe
else
@@ -30,3 +42,7 @@ if [ -x /usr/bin/makensis ]; then
else
echo "Skipping Windows setup.exe build due to missing NSIS"
fi
# Cleanup
rm ${BUILTDIR}/OpenRA.ico ${BUILTDIR}/RedAlert.ico ${BUILTDIR}/TiberianDawn.ico ${BUILTDIR}/Dune2000.ico
rm ${BUILTDIR}/RedAlert.exe ${BUILTDIR}/TiberianDawn.exe ${BUILTDIR}/Dune2000.exe