summaryrefslogtreecommitdiff
path: root/src/TrainerMod/TrainerMod.csproj
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2016-10-25 23:38:25 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2016-10-25 23:38:25 -0400
commit4042ca4b163008d5120ba247abc8f1655da32d55 (patch)
tree0b46dfcff507135155a585853fc83aff6565db1a /src/TrainerMod/TrainerMod.csproj
parentbe1c1c98147e63e1f13f9367cdb7e99842fe8496 (diff)
downloadSMAPI-4042ca4b163008d5120ba247abc8f1655da32d55.tar.gz
SMAPI-4042ca4b163008d5120ba247abc8f1655da32d55.tar.bz2
SMAPI-4042ca4b163008d5120ba247abc8f1655da32d55.zip
detect game path automatically (#126)
Diffstat (limited to 'src/TrainerMod/TrainerMod.csproj')
-rw-r--r--src/TrainerMod/TrainerMod.csproj35
1 files changed, 16 insertions, 19 deletions
diff --git a/src/TrainerMod/TrainerMod.csproj b/src/TrainerMod/TrainerMod.csproj
index cc195e2a..a6955c68 100644
--- a/src/TrainerMod/TrainerMod.csproj
+++ b/src/TrainerMod/TrainerMod.csproj
@@ -40,18 +40,18 @@
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
- <Choose>
- <When Condition="'$(SteamInstallPath)' != ''">
- <PropertyGroup>
- <SteamPath>$(SteamInstallPath)</SteamPath>
- </PropertyGroup>
- </When>
- <Otherwise>
- <PropertyGroup>
- <SteamPath>..\</SteamPath>
- </PropertyGroup>
- </Otherwise>
- </Choose>
+ <PropertyGroup>
+ <!-- Linux paths -->
+ <GamePath Condition="!Exists('$(GamePath)')">$(HOME)/GOG Games/Stardew Valley/game</GamePath>
+ <GamePath Condition="!Exists('$(GamePath)')">$(HOME)/.local/share/Steam/steamapps/common/Stardew Valley</GamePath>
+
+ <!-- Mac paths -->
+ <GamePath Condition="!Exists('$(GamePath)')">$(HOME)/Library/Application Support/Steam/steamapps/common/Stardew Valley/Contents/MacOS</GamePath>
+
+ <!-- Windows paths -->
+ <GamePath Condition="!Exists('$(GamePath)')">C:\Program Files (x86)\GalaxyClient\Games\Stardew Valley</GamePath>
+ <GamePath Condition="!Exists('$(GamePath)')">C:\Program Files (x86)\Steam\steamapps\common\Stardew Valley</GamePath>
+ </PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>False</Private>
@@ -64,7 +64,7 @@
<Private>True</Private>
</Reference>
<Reference Include="Stardew Valley">
- <HintPath>..\..\..\..\Games\SteamLibrary\steamapps\common\Stardew Valley\Stardew Valley.exe</HintPath>
+ <HintPath>$(GamePath)\Stardew Valley.exe</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
@@ -75,7 +75,7 @@
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="xTile">
- <HintPath>..\..\..\..\Games\SteamLibrary\steamapps\common\Stardew Valley\xTile.dll</HintPath>
+ <HintPath>$(GamePath)\xTile.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
@@ -103,11 +103,8 @@
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
+ <!-- if game path is invalid, show one user-friendly error instead of a slew of reference errors -->
+ <Error Condition="!Exists('$(GamePath)')" Text="Failed to find the game install path automatically; edit the *.csproj file and manually add a &lt;GamePath&gt; setting with the full directory path containing the Stardew Valley executable." />
</Target>
- <Target Name="AfterBuild">
- </Target>
- -->
</Project> \ No newline at end of file