diff --git a/README.md b/README.md index 7c59040..a66f71a 100644 --- a/README.md +++ b/README.md @@ -149,15 +149,21 @@ The latest builds are always at https://github.com/sauerbraten/p1xbraten/release ### Windows -Download sauerbraten.exe from the link above and put it into C:\Program Files (x86)\Sauerbraten\bin64\ (your Sauerbraten installation folder). +Download p1xbraten_\_setup.exe from the link above and execute it. p1xbraten will be installed alongside your existing Sauerbraten installation. ### macOS -Download sauerbraten_universal from the link above and put it into /Applications/sauerbraten.app/Contents/MacOS/, then `chmod +x /Applications/sauerbraten.app/Contents/MacOS/sauerbraten_universal`. +1. Open Finder +2. Press Shift + Command + G (⇧⌘G) +3. Go to `/Applications/sauerbraten.app/Contents/MacOS/` +4. Make a copy of sauerbraten_universal (in case you want to go back to the vanilla client in the future) +5. Download sauerbraten_universal from the link above and drag it into the Finder window, replacing the old file +6. Open a Terminal and type `chmod +x ` (note the space at the end), then drag the sauerbraten_universal file into the Terminal window +7. When it says `chmod +x /Applications/sauerbraten.app/Contents/MacOS/sauerbraten_universal`, press Enter to execute ### Linux -Download linux_64_client from the link above and put it into bin_unix/ inside of your Sauerbraten directory, then `chmod +x bin_unix/linux_64_client`. +Download linux_64_client from the link above and put it into bin_unix/ inside of your Sauerbraten directory (*after* backing up the original file), then `chmod +x bin_unix/linux_64_client`. ## Menu diff --git a/appveyor.yml b/appveyor.yml index 9d62224..e882192 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -11,11 +11,14 @@ for: - image: Visual Studio 2019 before_build: - ps: (Get-Content src/engine/main.cpp) -replace '', (git describe) | Set-Content src/engine/main.cpp + - ps: (Get-Content src/vcpp/p1xbraten.nsi) -replace '', (git describe) | Set-Content src/vcpp/p1xbraten.nsi build: - project: src/vcpp/sauerbraten.vcxproj + project: src/vcpp/p1xbraten_build_all.vcxproj verbosity: minimal + after_build: + - ps: makensis src/vcpp/p1xbraten.nsi artifacts: - - path: bin64/sauerbraten.exe + - path: p1xbraten_*_setup.exe - matrix: only: diff --git a/bin64/.gitkeep b/bin64/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/p1xbraten.bat b/p1xbraten.bat new file mode 100644 index 0000000..cd889a8 --- /dev/null +++ b/p1xbraten.bat @@ -0,0 +1,12 @@ +@ECHO OFF + +set SAUER_BIN=bin + +IF /I "%PROCESSOR_ARCHITECTURE%" == "amd64" ( + set SAUER_BIN=bin64 +) +IF /I "%PROCESSOR_ARCHITEW6432%" == "amd64" ( + set SAUER_BIN=bin64 +) + +start %SAUER_BIN%\p1xbraten.exe "-q$HOME\My Games\Sauerbraten" -glog.txt %* diff --git a/src/vcpp/p1xbraten.nsi b/src/vcpp/p1xbraten.nsi new file mode 100644 index 0000000..833141a --- /dev/null +++ b/src/vcpp/p1xbraten.nsi @@ -0,0 +1,67 @@ +Name "p1xbraten" + +OutFile "..\..\p1xbraten__setup.exe" + +InstallDir $PROGRAMFILES\Sauerbraten + +InstallDirRegKey HKLM "Software\p1xbraten" "Install_Dir" + +SetCompressor /SOLID lzma + +Page components +DirText "Choose your Sauerbraten installation directory. p1xbraten will be installed in it alongside the original files." +Page directory +Page instfiles + +UninstPage uninstConfirm +UninstPage instfiles + +Section "p1xbraten (required)" + + SectionIn RO + + SetOutPath $INSTDIR + + IfFileExists "$INSTDIR\sauerbraten.bat" VanillaFound VanillaNotFound + VanillaNotFound: + Abort "Vanilla Sauerbraten files not found in installation directory!" + VanillaFound: + + File "/oname=bin\p1xbraten.exe" "..\..\bin\p1xbraten_x86.exe" + File "/oname=bin64\p1xbraten.exe" "..\..\bin\p1xbraten_x64.exe" + File "..\..\p1xbraten.bat" + + WriteRegStr HKLM SOFTWARE\p1xbraten "Install_Dir" "$INSTDIR" + + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\p1xbraten" "DisplayName" "p1xbraten" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\p1xbraten" "UninstallString" '"$INSTDIR\uninstall_p1xbraten.exe"' + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\p1xbraten" "NoModify" 1 + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\p1xbraten" "NoRepair" 1 + WriteUninstaller "uninstall_p1xbraten.exe" + +SectionEnd + +Section "Start Menu Shortcuts" + + CreateDirectory "$SMPROGRAMS\p1xbraten" + + SetOutPath "$INSTDIR" + + CreateShortCut "$INSTDIR\p1xbraten.lnk" "$INSTDIR\p1xbraten.bat" "" "$INSTDIR\bin\p1xbraten.exe" 0 SW_SHOWMINIMIZED + CreateShortCut "$SMPROGRAMS\p1xbraten\p1xbraten.lnk" "$INSTDIR\p1xbraten.bat" "" "$INSTDIR\bin\p1xbraten.exe" 0 SW_SHOWMINIMIZED + CreateShortCut "$SMPROGRAMS\p1xbraten\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 + +SectionEnd + +Section "Uninstall" + + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\p1xbraten" + DeleteRegKey HKLM SOFTWARE\p1xbraten + + RMDir /r "$SMPROGRAMS\p1xbraten" + Delete "$INSTDIR\p1xbraten.lnk" + Delete "$INSTDIR\p1xbraten.bat" + Delete "$INSTDIR\bin\p1xbraten.exe" + Delete "$INSTDIR\bin64\p1xbraten.exe" + +SectionEnd diff --git a/src/vcpp/sauerbraten.rc b/src/vcpp/p1xbraten.rc similarity index 100% rename from src/vcpp/sauerbraten.rc rename to src/vcpp/p1xbraten.rc diff --git a/src/vcpp/sauerbraten.vcxproj b/src/vcpp/p1xbraten.vcxproj similarity index 98% rename from src/vcpp/sauerbraten.vcxproj rename to src/vcpp/p1xbraten.vcxproj index bcb9233..2739277 100644 --- a/src/vcpp/sauerbraten.vcxproj +++ b/src/vcpp/p1xbraten.vcxproj @@ -35,9 +35,9 @@ - sauerbraten + p1xbraten {06594C6D-6DA9-49DC-9A91-8F47221DDCFD} - sauerbraten + p1xbraten @@ -110,32 +110,27 @@ <_ProjectFileVersion>10.0.40219.1 - ..\..\bin\ - ..\..\bin64\ + ..\..\bin\ .\Release\ .\Release64\ false false true true - ..\..\bin\ - ..\..\bin64\ .\Debug\ .\Debug64\ true true - ..\..\bin\ - ..\..\bin64\ Profile\ Profile64\ false false - sauerbraten_debug - sauerbraten_debug - sauerbraten - sauerbraten - sauerbraten - sauerbraten + p1xbraten_x86_debug + p1xbraten_x64_debug + p1xbraten_x86 + p1xbraten_x64 + p1xbraten_x86 + p1xbraten_x64 @@ -1252,7 +1247,7 @@ - + diff --git a/src/vcpp/p1xbraten_build_all.vcxproj b/src/vcpp/p1xbraten_build_all.vcxproj new file mode 100644 index 0000000..229c351 --- /dev/null +++ b/src/vcpp/p1xbraten_build_all.vcxproj @@ -0,0 +1,14 @@ + + + + + + + + %(Platforms.Identity) + + + + + diff --git a/src/vcpp/sauerbraten.nsi b/src/vcpp/sauerbraten.nsi deleted file mode 100644 index 0dc6267..0000000 --- a/src/vcpp/sauerbraten.nsi +++ /dev/null @@ -1,64 +0,0 @@ -Name "Sauerbraten" - -OutFile "sauerbraten_20YY_MM_DD_foo_edition_win32_setup.exe" - -InstallDir $PROGRAMFILES\Sauerbraten - -InstallDirRegKey HKLM "Software\Sauerbraten" "Install_Dir" - -SetCompressor /SOLID lzma -XPStyle on - -Page components -Page directory -Page instfiles - -UninstPage uninstConfirm -UninstPage instfiles - -Section "Sauerbraten (required)" - - SectionIn RO - - SetOutPath $INSTDIR - - File /r "..\..\*.*" - - WriteRegStr HKLM SOFTWARE\Sauerbraten "Install_Dir" "$INSTDIR" - - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Sauerbraten" "DisplayName" "Sauerbraten" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Sauerbraten" "UninstallString" '"$INSTDIR\uninstall.exe"' - WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Sauerbraten" "NoModify" 1 - WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Sauerbraten" "NoRepair" 1 - WriteUninstaller "uninstall.exe" - - IfFileExists "$DOCUMENTS\My Games\Sauerbraten\config.cfg" ConfigFound NoConfig - ConfigFound: - Delete "$DOCUMENTS\My Games\Sauerbraten\old-config.cfg" - Rename "$DOCUMENTS\My Games\Sauerbraten\config.cfg" "$DOCUMENTS\My Games\Sauerbraten\old-config.cfg" - NoConfig: - -SectionEnd - -Section "Start Menu Shortcuts" - - CreateDirectory "$SMPROGRAMS\Sauerbraten" - - SetOutPath "$INSTDIR" - - CreateShortCut "$INSTDIR\Sauerbraten.lnk" "$INSTDIR\sauerbraten.bat" "" "$INSTDIR\bin\sauerbraten.exe" 0 SW_SHOWMINIMIZED - CreateShortCut "$SMPROGRAMS\Sauerbraten\Sauerbraten.lnk" "$INSTDIR\sauerbraten.bat" "" "$INSTDIR\bin\sauerbraten.exe" 0 SW_SHOWMINIMIZED - CreateShortCut "$SMPROGRAMS\Sauerbraten\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 - CreateShortCut "$SMPROGRAMS\Sauerbraten\README.lnk" "$INSTDIR\README.html" "" "$INSTDIR\README.html" 0 - -SectionEnd - -Section "Uninstall" - - DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Sauerbraten" - DeleteRegKey HKLM SOFTWARE\Sauerbraten - - RMDir /r "$SMPROGRAMS\Sauerbraten" - RMDir /r "$INSTDIR" - -SectionEnd