diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0b44c62..5cacda2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,17 +1,20 @@ name: Build EXE -on: [push, workflow_dispatch] +on: [push, workflow_dispatch] jobs: - build_exe: - runs-on: windows-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup MSBuild - uses: microsoft/setup-msbuild@v1 - - name: Build EXE - run: 'msbuild PathOfBuilding-Launcher.vcxproj /p:configuration=release /p:platform=x64' - - name: Archive EXE - uses: actions/upload-artifact@v3 - with: - name: Path of Building.exe - path: '${{ github.workspace }}/x64/Release/Path of Building.exe' + build_exes: + strategy: + matrix: + version: ['', -PoE2] + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v1 + - name: Build EXEs + run: 'msbuild PathOfBuilding-Launcher.vcxproj /p:configuration=release${{ matrix.version }} /p:platform=x64' + - name: Archive EXE + uses: actions/upload-artifact@v4 + with: + name: Path of Building${{ matrix.version }}.exe + path: '${{ github.workspace }}/x64/Release${{ matrix.version }}/Path of Building${{ matrix.version }}.exe' diff --git a/Launcher.cpp b/Launcher.cpp index 19657a2..af2d95f 100644 --- a/Launcher.cpp +++ b/Launcher.cpp @@ -199,12 +199,16 @@ bool InsertLaunchLua(std::vector &commandLine, std::string &firstL } // Check for the registry key left by the installer - // HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Path of Building Community\InstallLocation + // HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Path of Building Community[-PoE2]\InstallLocation { DWORD dwType = 0; DWORD dwSize = MAX_PATH; wchar_t wszValue[MAX_PATH]{}; +#ifndef GAMEVERSION_2 DWORD dwStatus = RegGetValue(HKEY_CURRENT_USER, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Path of Building Community", L"InstallLocation", RRF_RT_REG_SZ, &dwType, wszValue, &dwSize); +#else + DWORD dwStatus = RegGetValue(HKEY_CURRENT_USER, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Path of Building Community-PoE2", L"InstallLocation", RRF_RT_REG_SZ, &dwType, wszValue, &dwSize); +#endif if (dwStatus == ERROR_SUCCESS && dwSize > sizeof(wchar_t)) { // Strip the quotes around the value @@ -222,14 +226,18 @@ bool InsertLaunchLua(std::vector &commandLine, std::string &firstL if (SHGetSpecialFolderPath(nullptr, wszAppDataPath, CSIDL_APPDATA, false)) { std::wstring basePath(wszAppDataPath); +#ifndef GAMEVERSION_2 basePath += L"\\Path of Building Community\\"; +#else + basePath += L"\\Path of Building Community-PoE2\\"; +#endif if (FindLaunchLua(basePath, commandLine, firstLine)) { return true; } } } - +#ifndef GAMEVERSION_2 // Look in the %PROGRAMDATA% folder, which is where the original PoB installer puts the lua files { wchar_t wszAppDataPath[MAX_PATH]{}; @@ -243,6 +251,7 @@ bool InsertLaunchLua(std::vector &commandLine, std::string &firstL } } } +#endif return false; } diff --git a/PathOfBuilding-Launcher.sln b/PathOfBuilding-Launcher.sln index 67429ee..0d5480d 100644 --- a/PathOfBuilding-Launcher.sln +++ b/PathOfBuilding-Launcher.sln @@ -1,7 +1,7 @@ - + Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30907.101 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35027.167 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PathOfBuilding-Launcher", "PathOfBuilding-Launcher.vcxproj", "{3772AF5F-3866-4768-994A-AB8B1647DBD8}" EndProject @@ -9,18 +9,30 @@ Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 + Debug-PoE2|x64 = Debug-PoE2|x64 + Debug-PoE2|x86 = Debug-PoE2|x86 Release|x64 = Release|x64 Release|x86 = Release|x86 + Release-PoE2|x64 = Release-PoE2|x64 + Release-PoE2|x86 = Release-PoE2|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {3772AF5F-3866-4768-994A-AB8B1647DBD8}.Debug|x64.ActiveCfg = Debug|x64 {3772AF5F-3866-4768-994A-AB8B1647DBD8}.Debug|x64.Build.0 = Debug|x64 {3772AF5F-3866-4768-994A-AB8B1647DBD8}.Debug|x86.ActiveCfg = Debug|Win32 {3772AF5F-3866-4768-994A-AB8B1647DBD8}.Debug|x86.Build.0 = Debug|Win32 + {3772AF5F-3866-4768-994A-AB8B1647DBD8}.Debug-PoE2|x64.ActiveCfg = Debug-PoE2|x64 + {3772AF5F-3866-4768-994A-AB8B1647DBD8}.Debug-PoE2|x64.Build.0 = Debug-PoE2|x64 + {3772AF5F-3866-4768-994A-AB8B1647DBD8}.Debug-PoE2|x86.ActiveCfg = Debug-PoE2|Win32 + {3772AF5F-3866-4768-994A-AB8B1647DBD8}.Debug-PoE2|x86.Build.0 = Debug-PoE2|Win32 {3772AF5F-3866-4768-994A-AB8B1647DBD8}.Release|x64.ActiveCfg = Release|x64 {3772AF5F-3866-4768-994A-AB8B1647DBD8}.Release|x64.Build.0 = Release|x64 {3772AF5F-3866-4768-994A-AB8B1647DBD8}.Release|x86.ActiveCfg = Release|Win32 {3772AF5F-3866-4768-994A-AB8B1647DBD8}.Release|x86.Build.0 = Release|Win32 + {3772AF5F-3866-4768-994A-AB8B1647DBD8}.Release-PoE2|x64.ActiveCfg = Release-PoE2|x64 + {3772AF5F-3866-4768-994A-AB8B1647DBD8}.Release-PoE2|x64.Build.0 = Release-PoE2|x64 + {3772AF5F-3866-4768-994A-AB8B1647DBD8}.Release-PoE2|x86.ActiveCfg = Release-PoE2|Win32 + {3772AF5F-3866-4768-994A-AB8B1647DBD8}.Release-PoE2|x86.Build.0 = Release-PoE2|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/PathOfBuilding-Launcher.vcxproj b/PathOfBuilding-Launcher.vcxproj index 46187b6..cf042fd 100644 --- a/PathOfBuilding-Launcher.vcxproj +++ b/PathOfBuilding-Launcher.vcxproj @@ -1,10 +1,26 @@ + + Debug-PoE2 + Win32 + + + Debug-PoE2 + x64 + Debug Win32 + + Release-PoE2 + Win32 + + + Release-PoE2 + x64 + Release Win32 @@ -32,6 +48,12 @@ v142 Unicode + + Application + true + v142 + Unicode + Application false @@ -39,12 +61,25 @@ true Unicode + + Application + false + v142 + true + Unicode + Application true v142 Unicode + + Application + true + v142 + Unicode + Application false @@ -52,6 +87,13 @@ true Unicode + + Application + false + v142 + true + Unicode + @@ -60,32 +102,60 @@ + + + + + + + + + + + + true Path of Building + + true + Path of Building-PoE2 + false Path of Building + + false + Path of Building-PoE2 + true Path of Building + + true + Path of Building-PoE2 + false Path of Building + + false + Path of Building-PoE2 + Level3 @@ -100,6 +170,20 @@ true + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;GAMEVERSION_2;%(PreprocessorDefinitions) + true + stdcpp17 + MultiThreadedDebug + + + Windows + true + + Level3 @@ -118,6 +202,24 @@ true + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;GAMEVERSION_2;%(PreprocessorDefinitions) + true + stdcpp17 + MultiThreaded + + + Windows + true + true + true + + Level3 @@ -132,6 +234,20 @@ true + + + Level3 + true + _DEBUG;_CONSOLE;GAMEVERSION_2;%(PreprocessorDefinitions) + true + stdcpp17 + MultiThreadedDebug + + + Windows + true + + Level3 @@ -150,6 +266,24 @@ true + + + Level3 + true + true + true + NDEBUG;_CONSOLE;GAMEVERSION_2;%(PreprocessorDefinitions) + true + stdcpp17 + MultiThreaded + + + Windows + true + true + true + +