forked from baldurk/renderdoc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a hack stub renderdocui.exe for auto-updated builds from v0.x
* This is a temporary fix, in future we want to actually update shortcuts etc, but this is a low risk fix right before we release.
- Loading branch information
Showing
4 changed files
with
191 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/****************************************************************************** | ||
* The MIT License (MIT) | ||
* | ||
* Copyright (c) 2018 Baldur Karlsson | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
******************************************************************************/ | ||
|
||
#include <windows.h> | ||
|
||
int WINAPI wWinMain(_In_ HINSTANCE hInst, _In_opt_ HINSTANCE hPrevInstance, _In_ LPWSTR lpCmdLine, | ||
_In_ int nShowCmd) | ||
{ | ||
size_t len = wcslen(lpCmdLine) + 64; | ||
|
||
wchar_t *paramsAlloc = new wchar_t[len + 1]; | ||
|
||
ZeroMemory(paramsAlloc, sizeof(wchar_t) * (len + 1)); | ||
|
||
// get the path to this file | ||
wchar_t curFile[512] = {0}; | ||
GetModuleFileNameW(NULL, curFile, 511); | ||
|
||
// find the last / or \ and erase everything after that to get the folder | ||
wchar_t *w = curFile + wcslen(curFile); | ||
|
||
while(w > curFile && *w != '/' && *w != '\\') | ||
w--; | ||
|
||
if(w > curFile) | ||
*(w + 1) = 0; | ||
else | ||
curFile[0] = 0; | ||
|
||
// transform / to \ just in case | ||
w = curFile; | ||
while(*w) | ||
{ | ||
if(*w == '/') | ||
*w = '\\'; | ||
w++; | ||
} | ||
|
||
wcscat_s(curFile, 511, L"qrenderdoc.exe"); | ||
|
||
wcscpy_s(paramsAlloc, len, curFile); | ||
|
||
wcscat_s(paramsAlloc, len, L" "); | ||
|
||
wcscat_s(paramsAlloc, len, lpCmdLine); | ||
|
||
PROCESS_INFORMATION pi; | ||
STARTUPINFOW si; | ||
ZeroMemory(&pi, sizeof(pi)); | ||
ZeroMemory(&si, sizeof(si)); | ||
|
||
CreateProcessW(curFile, paramsAlloc, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); | ||
|
||
if(pi.dwProcessId != 0) | ||
{ | ||
CloseHandle(pi.hProcess); | ||
CloseHandle(pi.hThread); | ||
} | ||
|
||
delete[] paramsAlloc; | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ItemGroup Label="ProjectConfigurations"> | ||
<ProjectConfiguration Include="Development|Win32"> | ||
<Configuration>Development</Configuration> | ||
<Platform>Win32</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Release|Win32"> | ||
<Configuration>Release</Configuration> | ||
<Platform>Win32</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Development|x64"> | ||
<Configuration>Development</Configuration> | ||
<Platform>x64</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Release|x64"> | ||
<Configuration>Release</Configuration> | ||
<Platform>x64</Platform> | ||
</ProjectConfiguration> | ||
</ItemGroup> | ||
<PropertyGroup Label="Globals"> | ||
<ProjectGuid>{37955C79-D91D-423F-8C6C-8F5BCF4F28D4}</ProjectGuid> | ||
<Keyword>Win32Proj</Keyword> | ||
<RootNamespace>renderdocui_stub</RootNamespace> | ||
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion> | ||
<ProjectName>renderdocui_stub</ProjectName> | ||
</PropertyGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | ||
<PropertyGroup> | ||
<ConfigurationType>Application</ConfigurationType> | ||
<UseDebugLibraries>true</UseDebugLibraries> | ||
<PlatformToolset>v140</PlatformToolset> | ||
<OutputDirectory>$(SolutionDir)$(Platform)\$(Configuration)\</OutputDirectory> | ||
<SolutionRelativeIntDir>$(Platform)\$(Configuration)\obj\$(ProjectName)\</SolutionRelativeIntDir> | ||
<CharacterSet>Unicode</CharacterSet> | ||
<PrimaryOutput>renderdocui</PrimaryOutput> | ||
<TargetName>renderdocui</TargetName> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<IntDir>$(SolutionDir)$(SolutionRelativeIntDir)</IntDir> | ||
<IntermediateDirectory>$(IntDir)</IntermediateDirectory> | ||
<OutDir>$(OutputDirectory)\</OutDir> | ||
</PropertyGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | ||
<ImportGroup Label="ExtensionSettings"> | ||
</ImportGroup> | ||
<ImportGroup Label="Shared"> | ||
</ImportGroup> | ||
<ImportGroup> | ||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
</ImportGroup> | ||
<PropertyGroup Label="UserMacros" /> | ||
<PropertyGroup> | ||
<LinkIncremental>false</LinkIncremental> | ||
</PropertyGroup> | ||
<ItemDefinitionGroup> | ||
<ClCompile> | ||
<WarningLevel>Level3</WarningLevel> | ||
<PrecompiledHeader> | ||
</PrecompiledHeader> | ||
<Optimization>MaxSpeed</Optimization> | ||
<FunctionLevelLinking>true</FunctionLevelLinking> | ||
<IntrinsicFunctions>true</IntrinsicFunctions> | ||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
<BasicRuntimeChecks>Default</BasicRuntimeChecks> | ||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> | ||
</ClCompile> | ||
<Link> | ||
<SubSystem>Windows</SubSystem> | ||
<EnableCOMDATFolding>true</EnableCOMDATFolding> | ||
<OptimizeReferences>true</OptimizeReferences> | ||
<GenerateDebugInformation>true</GenerateDebugInformation> | ||
</Link> | ||
<ResourceCompile> | ||
<AdditionalIncludeDirectories>$(SolutionDir)renderdoc\api\replay</AdditionalIncludeDirectories> | ||
</ResourceCompile> | ||
</ItemDefinitionGroup> | ||
<ItemGroup> | ||
<ClCompile Include="renderdocui_stub.cpp" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ResourceCompile Include="..\renderdoccmd\renderdoccmd.rc" /> | ||
</ItemGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | ||
<ImportGroup Label="ExtensionTargets"> | ||
</ImportGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ItemGroup> | ||
<ClCompile Include="renderdocui_stub.cpp" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ResourceCompile Include="..\renderdoccmd\renderdoccmd.rc" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters