Skip to content

Commit

Permalink
create combined x86 and x64 Windows installer
Browse files Browse the repository at this point in the history
  • Loading branch information
sauerbraten committed Feb 19, 2021
1 parent ee6ca14 commit ba30ed1
Show file tree
Hide file tree
Showing 9 changed files with 117 additions and 84 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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_\<version\>_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

Expand Down
7 changes: 5 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@ for:
- image: Visual Studio 2019
before_build:
- ps: (Get-Content src/engine/main.cpp) -replace '<git-dev>', (git describe) | Set-Content src/engine/main.cpp
- ps: (Get-Content src/vcpp/p1xbraten.nsi) -replace '<git-dev>', (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:
Expand Down
Empty file removed bin64/.gitkeep
Empty file.
12 changes: 12 additions & 0 deletions p1xbraten.bat
Original file line number Diff line number Diff line change
@@ -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 %*
67 changes: 67 additions & 0 deletions src/vcpp/p1xbraten.nsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
Name "p1xbraten"

OutFile "..\..\p1xbraten_<git-dev>_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
File renamed without changes.
25 changes: 10 additions & 15 deletions src/vcpp/sauerbraten.vcxproj → src/vcpp/p1xbraten.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>sauerbraten</ProjectName>
<ProjectName>p1xbraten</ProjectName>
<ProjectGuid>{06594C6D-6DA9-49DC-9A91-8F47221DDCFD}</ProjectGuid>
<RootNamespace>sauerbraten</RootNamespace>
<RootNamespace>p1xbraten</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'" Label="Configuration">
Expand Down Expand Up @@ -110,32 +110,27 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\bin\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\bin64\</OutDir>
<OutDir>..\..\bin\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\Release64\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</GenerateManifest>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\bin\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\bin64\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\Debug64\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">..\..\bin\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Profile|x64'">..\..\bin64\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">Profile\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Profile|x64'">Profile64\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Profile|x64'">false</LinkIncremental>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">sauerbraten_debug</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">sauerbraten_debug</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">sauerbraten</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Profile|x64'">sauerbraten</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">sauerbraten</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">sauerbraten</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">p1xbraten_x86_debug</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">p1xbraten_x64_debug</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">p1xbraten_x86</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Profile|x64'">p1xbraten_x64</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">p1xbraten_x86</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">p1xbraten_x64</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
Expand Down Expand Up @@ -1252,7 +1247,7 @@
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="sauerbraten.rc" />
<ResourceCompile Include="p1xbraten.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
14 changes: 14 additions & 0 deletions src/vcpp/p1xbraten_build_all.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="BuildAll">
<Target Name="BuildAll">
<ItemGroup>
<Configurations Include="Release"/>
<Platforms Include="Win32;x64"/>
<ConfigAndPlatform Include="@(Configurations)">
<Platform>%(Platforms.Identity)</Platform>
</ConfigAndPlatform>
</ItemGroup>
<MSBuild Projects="p1xbraten.vcxproj" Targets="Build"
Properties="Configuration=%(ConfigAndPlatform.Identity);Platform=%(ConfigAndPlatform.Platform)"/>
</Target>
</Project>
64 changes: 0 additions & 64 deletions src/vcpp/sauerbraten.nsi

This file was deleted.

0 comments on commit ba30ed1

Please sign in to comment.