mirror of
				https://github.com/cmderdev/cmder.git
				synced 2025-11-04 11:22:13 +08:00 
			
		
		
		
	XP compatible launcher
Building will have to be sorted but it's a start, please test as I don't have an XP machine anymore.
This commit is contained in:
		
							
								
								
									
										17
									
								
								build.rb
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								build.rb
									
									
									
									
									
								
							@@ -98,11 +98,26 @@ get_file('msysgit', 'label:Type-Archive label:Featured')
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
puts 'Creating executable'
 | 
					puts 'Creating executable'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					puts 'Build for XP? (Default: No)'
 | 
				
			||||||
 | 
					if gets.downcase =='yes' or 'y'
 | 
				
			||||||
 | 
					    XP = true
 | 
				
			||||||
 | 
					elsif gets.downcase == 'no' or 'n'
 | 
				
			||||||
 | 
					    XP = false
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
					    puts 'Defaulting to non-XP build'
 | 
				
			||||||
 | 
					    XP = false
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if build_exe
 | 
					if build_exe
 | 
				
			||||||
    Dir.chdir('../launcher')
 | 
					    Dir.chdir('../launcher')
 | 
				
			||||||
 | 
					    if XP
 | 
				
			||||||
 | 
					        puts 'Building XP Compatible Launcher...'
 | 
				
			||||||
 | 
					        status = system('msbuild /p:Configuration=ReleaseXP')
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
        status = system('msbuild /p:Configuration=Release')
 | 
					        status = system('msbuild /p:Configuration=Release')
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
    unless status
 | 
					    unless status
 | 
				
			||||||
        puts 'Looks like the build failied'
 | 
					        puts 'Looks like the build failed'
 | 
				
			||||||
        exit(1)
 | 
					        exit(1)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
Microsoft Visual Studio Solution File, Format Version 12.00
 | 
					Microsoft Visual Studio Solution File, Format Version 12.00
 | 
				
			||||||
# Visual Studio 2013
 | 
					# Visual Studio Express 2013 for Windows Desktop
 | 
				
			||||||
VisualStudioVersion = 12.0.21005.1
 | 
					VisualStudioVersion = 12.0.21005.1
 | 
				
			||||||
MinimumVisualStudioVersion = 10.0.40219.1
 | 
					MinimumVisualStudioVersion = 10.0.40219.1
 | 
				
			||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CmderLauncher", "CmderLauncher.vcxproj", "{4A8485A5-B7DD-4C44-B7F6-3E2765DD0CD3}"
 | 
					Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CmderLauncher", "CmderLauncher.vcxproj", "{4A8485A5-B7DD-4C44-B7F6-3E2765DD0CD3}"
 | 
				
			||||||
@@ -8,13 +8,19 @@ EndProject
 | 
				
			|||||||
Global
 | 
					Global
 | 
				
			||||||
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 | 
						GlobalSection(SolutionConfigurationPlatforms) = preSolution
 | 
				
			||||||
		Debug|Win32 = Debug|Win32
 | 
							Debug|Win32 = Debug|Win32
 | 
				
			||||||
 | 
							DebugXP|Win32 = DebugXP|Win32
 | 
				
			||||||
		Release|Win32 = Release|Win32
 | 
							Release|Win32 = Release|Win32
 | 
				
			||||||
 | 
							ReleaseXP|Win32 = ReleaseXP|Win32
 | 
				
			||||||
	EndGlobalSection
 | 
						EndGlobalSection
 | 
				
			||||||
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
 | 
						GlobalSection(ProjectConfigurationPlatforms) = postSolution
 | 
				
			||||||
		{4A8485A5-B7DD-4C44-B7F6-3E2765DD0CD3}.Debug|Win32.ActiveCfg = Debug|Win32
 | 
							{4A8485A5-B7DD-4C44-B7F6-3E2765DD0CD3}.Debug|Win32.ActiveCfg = Debug|Win32
 | 
				
			||||||
		{4A8485A5-B7DD-4C44-B7F6-3E2765DD0CD3}.Debug|Win32.Build.0 = Debug|Win32
 | 
							{4A8485A5-B7DD-4C44-B7F6-3E2765DD0CD3}.Debug|Win32.Build.0 = Debug|Win32
 | 
				
			||||||
 | 
							{4A8485A5-B7DD-4C44-B7F6-3E2765DD0CD3}.DebugXP|Win32.ActiveCfg = DebugXP|Win32
 | 
				
			||||||
 | 
							{4A8485A5-B7DD-4C44-B7F6-3E2765DD0CD3}.DebugXP|Win32.Build.0 = DebugXP|Win32
 | 
				
			||||||
		{4A8485A5-B7DD-4C44-B7F6-3E2765DD0CD3}.Release|Win32.ActiveCfg = Release|Win32
 | 
							{4A8485A5-B7DD-4C44-B7F6-3E2765DD0CD3}.Release|Win32.ActiveCfg = Release|Win32
 | 
				
			||||||
		{4A8485A5-B7DD-4C44-B7F6-3E2765DD0CD3}.Release|Win32.Build.0 = Release|Win32
 | 
							{4A8485A5-B7DD-4C44-B7F6-3E2765DD0CD3}.Release|Win32.Build.0 = Release|Win32
 | 
				
			||||||
 | 
							{4A8485A5-B7DD-4C44-B7F6-3E2765DD0CD3}.ReleaseXP|Win32.ActiveCfg = ReleaseXP|Win32
 | 
				
			||||||
 | 
							{4A8485A5-B7DD-4C44-B7F6-3E2765DD0CD3}.ReleaseXP|Win32.Build.0 = ReleaseXP|Win32
 | 
				
			||||||
	EndGlobalSection
 | 
						EndGlobalSection
 | 
				
			||||||
	GlobalSection(SolutionProperties) = preSolution
 | 
						GlobalSection(SolutionProperties) = preSolution
 | 
				
			||||||
		HideSolutionNode = FALSE
 | 
							HideSolutionNode = FALSE
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,10 +1,18 @@
 | 
				
			|||||||
<?xml version="1.0" encoding="utf-8"?>
 | 
					<?xml version="1.0" encoding="utf-8"?>
 | 
				
			||||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 | 
					<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 | 
				
			||||||
  <ItemGroup Label="ProjectConfigurations">
 | 
					  <ItemGroup Label="ProjectConfigurations">
 | 
				
			||||||
 | 
					    <ProjectConfiguration Include="DebugXP|Win32">
 | 
				
			||||||
 | 
					      <Configuration>DebugXP</Configuration>
 | 
				
			||||||
 | 
					      <Platform>Win32</Platform>
 | 
				
			||||||
 | 
					    </ProjectConfiguration>
 | 
				
			||||||
    <ProjectConfiguration Include="Debug|Win32">
 | 
					    <ProjectConfiguration Include="Debug|Win32">
 | 
				
			||||||
      <Configuration>Debug</Configuration>
 | 
					      <Configuration>Debug</Configuration>
 | 
				
			||||||
      <Platform>Win32</Platform>
 | 
					      <Platform>Win32</Platform>
 | 
				
			||||||
    </ProjectConfiguration>
 | 
					    </ProjectConfiguration>
 | 
				
			||||||
 | 
					    <ProjectConfiguration Include="ReleaseXP|Win32">
 | 
				
			||||||
 | 
					      <Configuration>ReleaseXP</Configuration>
 | 
				
			||||||
 | 
					      <Platform>Win32</Platform>
 | 
				
			||||||
 | 
					    </ProjectConfiguration>
 | 
				
			||||||
    <ProjectConfiguration Include="Release|Win32">
 | 
					    <ProjectConfiguration Include="Release|Win32">
 | 
				
			||||||
      <Configuration>Release</Configuration>
 | 
					      <Configuration>Release</Configuration>
 | 
				
			||||||
      <Platform>Win32</Platform>
 | 
					      <Platform>Win32</Platform>
 | 
				
			||||||
@@ -22,6 +30,12 @@
 | 
				
			|||||||
    <PlatformToolset>v120</PlatformToolset>
 | 
					    <PlatformToolset>v120</PlatformToolset>
 | 
				
			||||||
    <CharacterSet>Unicode</CharacterSet>
 | 
					    <CharacterSet>Unicode</CharacterSet>
 | 
				
			||||||
  </PropertyGroup>
 | 
					  </PropertyGroup>
 | 
				
			||||||
 | 
					  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugXP|Win32'" Label="Configuration">
 | 
				
			||||||
 | 
					    <ConfigurationType>Application</ConfigurationType>
 | 
				
			||||||
 | 
					    <UseDebugLibraries>true</UseDebugLibraries>
 | 
				
			||||||
 | 
					    <PlatformToolset>v120_xp</PlatformToolset>
 | 
				
			||||||
 | 
					    <CharacterSet>Unicode</CharacterSet>
 | 
				
			||||||
 | 
					  </PropertyGroup>
 | 
				
			||||||
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
 | 
					  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
 | 
				
			||||||
    <ConfigurationType>Application</ConfigurationType>
 | 
					    <ConfigurationType>Application</ConfigurationType>
 | 
				
			||||||
    <UseDebugLibraries>false</UseDebugLibraries>
 | 
					    <UseDebugLibraries>false</UseDebugLibraries>
 | 
				
			||||||
@@ -29,24 +43,45 @@
 | 
				
			|||||||
    <WholeProgramOptimization>true</WholeProgramOptimization>
 | 
					    <WholeProgramOptimization>true</WholeProgramOptimization>
 | 
				
			||||||
    <CharacterSet>Unicode</CharacterSet>
 | 
					    <CharacterSet>Unicode</CharacterSet>
 | 
				
			||||||
  </PropertyGroup>
 | 
					  </PropertyGroup>
 | 
				
			||||||
 | 
					  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseXP|Win32'" Label="Configuration">
 | 
				
			||||||
 | 
					    <ConfigurationType>Application</ConfigurationType>
 | 
				
			||||||
 | 
					    <UseDebugLibraries>false</UseDebugLibraries>
 | 
				
			||||||
 | 
					    <PlatformToolset>v120_xp</PlatformToolset>
 | 
				
			||||||
 | 
					    <WholeProgramOptimization>true</WholeProgramOptimization>
 | 
				
			||||||
 | 
					    <CharacterSet>Unicode</CharacterSet>
 | 
				
			||||||
 | 
					  </PropertyGroup>
 | 
				
			||||||
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
 | 
					  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
 | 
				
			||||||
  <ImportGroup Label="ExtensionSettings">
 | 
					  <ImportGroup Label="ExtensionSettings">
 | 
				
			||||||
  </ImportGroup>
 | 
					  </ImportGroup>
 | 
				
			||||||
  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
 | 
					  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
 | 
				
			||||||
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 | 
					    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 | 
				
			||||||
  </ImportGroup>
 | 
					  </ImportGroup>
 | 
				
			||||||
 | 
					  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugXP|Win32'" Label="PropertySheets">
 | 
				
			||||||
 | 
					    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 | 
				
			||||||
 | 
					  </ImportGroup>
 | 
				
			||||||
  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
 | 
					  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
 | 
				
			||||||
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 | 
					    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 | 
				
			||||||
  </ImportGroup>
 | 
					  </ImportGroup>
 | 
				
			||||||
 | 
					  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseXP|Win32'" Label="PropertySheets">
 | 
				
			||||||
 | 
					    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 | 
				
			||||||
 | 
					  </ImportGroup>
 | 
				
			||||||
  <PropertyGroup Label="UserMacros" />
 | 
					  <PropertyGroup Label="UserMacros" />
 | 
				
			||||||
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
 | 
					  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
 | 
				
			||||||
    <LinkIncremental>true</LinkIncremental>
 | 
					    <LinkIncremental>true</LinkIncremental>
 | 
				
			||||||
    <TargetName>Cmder</TargetName>
 | 
					    <TargetName>Cmder</TargetName>
 | 
				
			||||||
  </PropertyGroup>
 | 
					  </PropertyGroup>
 | 
				
			||||||
 | 
					  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugXP|Win32'">
 | 
				
			||||||
 | 
					    <LinkIncremental>true</LinkIncremental>
 | 
				
			||||||
 | 
					    <TargetName>Cmder</TargetName>
 | 
				
			||||||
 | 
					  </PropertyGroup>
 | 
				
			||||||
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
 | 
					  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
 | 
				
			||||||
    <LinkIncremental>false</LinkIncremental>
 | 
					    <LinkIncremental>false</LinkIncremental>
 | 
				
			||||||
    <TargetName>Cmder</TargetName>
 | 
					    <TargetName>Cmder</TargetName>
 | 
				
			||||||
  </PropertyGroup>
 | 
					  </PropertyGroup>
 | 
				
			||||||
 | 
					  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseXP|Win32'">
 | 
				
			||||||
 | 
					    <LinkIncremental>false</LinkIncremental>
 | 
				
			||||||
 | 
					    <TargetName>Cmder</TargetName>
 | 
				
			||||||
 | 
					  </PropertyGroup>
 | 
				
			||||||
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
 | 
					  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
 | 
				
			||||||
    <ClCompile>
 | 
					    <ClCompile>
 | 
				
			||||||
      <PrecompiledHeader>
 | 
					      <PrecompiledHeader>
 | 
				
			||||||
@@ -61,6 +96,20 @@
 | 
				
			|||||||
      <GenerateDebugInformation>true</GenerateDebugInformation>
 | 
					      <GenerateDebugInformation>true</GenerateDebugInformation>
 | 
				
			||||||
    </Link>
 | 
					    </Link>
 | 
				
			||||||
  </ItemDefinitionGroup>
 | 
					  </ItemDefinitionGroup>
 | 
				
			||||||
 | 
					  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugXP|Win32'">
 | 
				
			||||||
 | 
					    <ClCompile>
 | 
				
			||||||
 | 
					      <PrecompiledHeader>
 | 
				
			||||||
 | 
					      </PrecompiledHeader>
 | 
				
			||||||
 | 
					      <WarningLevel>Level3</WarningLevel>
 | 
				
			||||||
 | 
					      <Optimization>Disabled</Optimization>
 | 
				
			||||||
 | 
					      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;XP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
 | 
				
			||||||
 | 
					      <SDLCheck>true</SDLCheck>
 | 
				
			||||||
 | 
					    </ClCompile>
 | 
				
			||||||
 | 
					    <Link>
 | 
				
			||||||
 | 
					      <SubSystem>Windows</SubSystem>
 | 
				
			||||||
 | 
					      <GenerateDebugInformation>true</GenerateDebugInformation>
 | 
				
			||||||
 | 
					    </Link>
 | 
				
			||||||
 | 
					  </ItemDefinitionGroup>
 | 
				
			||||||
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
 | 
					  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
 | 
				
			||||||
    <ClCompile>
 | 
					    <ClCompile>
 | 
				
			||||||
      <WarningLevel>Level3</WarningLevel>
 | 
					      <WarningLevel>Level3</WarningLevel>
 | 
				
			||||||
@@ -83,6 +132,28 @@
 | 
				
			|||||||
      <Command>copy $(TargetPath) $(SolutionDir)..\$(TargetFileName)</Command>
 | 
					      <Command>copy $(TargetPath) $(SolutionDir)..\$(TargetFileName)</Command>
 | 
				
			||||||
    </PostBuildEvent>
 | 
					    </PostBuildEvent>
 | 
				
			||||||
  </ItemDefinitionGroup>
 | 
					  </ItemDefinitionGroup>
 | 
				
			||||||
 | 
					  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseXP|Win32'">
 | 
				
			||||||
 | 
					    <ClCompile>
 | 
				
			||||||
 | 
					      <WarningLevel>Level3</WarningLevel>
 | 
				
			||||||
 | 
					      <PrecompiledHeader>
 | 
				
			||||||
 | 
					      </PrecompiledHeader>
 | 
				
			||||||
 | 
					      <Optimization>MinSpace</Optimization>
 | 
				
			||||||
 | 
					      <FunctionLevelLinking>true</FunctionLevelLinking>
 | 
				
			||||||
 | 
					      <IntrinsicFunctions>false</IntrinsicFunctions>
 | 
				
			||||||
 | 
					      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;XP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
 | 
				
			||||||
 | 
					      <SDLCheck>true</SDLCheck>
 | 
				
			||||||
 | 
					      <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
 | 
				
			||||||
 | 
					    </ClCompile>
 | 
				
			||||||
 | 
					    <Link>
 | 
				
			||||||
 | 
					      <SubSystem>Windows</SubSystem>
 | 
				
			||||||
 | 
					      <GenerateDebugInformation>true</GenerateDebugInformation>
 | 
				
			||||||
 | 
					      <EnableCOMDATFolding>true</EnableCOMDATFolding>
 | 
				
			||||||
 | 
					      <OptimizeReferences>true</OptimizeReferences>
 | 
				
			||||||
 | 
					    </Link>
 | 
				
			||||||
 | 
					    <PostBuildEvent>
 | 
				
			||||||
 | 
					      <Command>copy $(TargetPath) $(SolutionDir)..\$(TargetFileName)</Command>
 | 
				
			||||||
 | 
					    </PostBuildEvent>
 | 
				
			||||||
 | 
					  </ItemDefinitionGroup>
 | 
				
			||||||
  <ItemGroup>
 | 
					  <ItemGroup>
 | 
				
			||||||
    <ResourceCompile Include="src\Resource.rc" />
 | 
					    <ResourceCompile Include="src\Resource.rc" />
 | 
				
			||||||
  </ItemGroup>
 | 
					  </ItemGroup>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -192,8 +192,13 @@ void UnregisterShellMenu(std::wstring opt)
 | 
				
			|||||||
	FAIL_ON_ERROR(
 | 
						FAIL_ON_ERROR(
 | 
				
			||||||
		RegCreateKeyEx(root, SHELL_MENU_REGISTRY_PATH, 0, NULL,
 | 
							RegCreateKeyEx(root, SHELL_MENU_REGISTRY_PATH, 0, NULL,
 | 
				
			||||||
		REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &cmderKey, NULL));
 | 
							REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &cmderKey, NULL));
 | 
				
			||||||
 | 
					#ifdef XP
 | 
				
			||||||
 | 
						FAIL_ON_ERROR(SHDeleteKey(cmderKey, NULL));
 | 
				
			||||||
 | 
						FAIL_ON_ERROR(SHDeleteKey(root, SHELL_MENU_REGISTRY_PATH));
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
	FAIL_ON_ERROR(RegDeleteTree(cmderKey, NULL));
 | 
						FAIL_ON_ERROR(RegDeleteTree(cmderKey, NULL));
 | 
				
			||||||
	FAIL_ON_ERROR(RegDeleteKey(root, SHELL_MENU_REGISTRY_PATH));
 | 
						FAIL_ON_ERROR(RegDeleteKey(root, SHELL_MENU_REGISTRY_PATH));
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
	RegCloseKey(cmderKey);
 | 
						RegCloseKey(cmderKey);
 | 
				
			||||||
	RegCloseKey(root);
 | 
						RegCloseKey(root);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user