diff --git a/build.rb b/build.rb index 7665541..9f3084f 100644 --- a/build.rb +++ b/build.rb @@ -98,11 +98,26 @@ get_file('msysgit', 'label:Type-Archive label:Featured') 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 Dir.chdir('../launcher') - status = system('msbuild /p:Configuration=Release') + if XP + puts 'Building XP Compatible Launcher...' + status = system('msbuild /p:Configuration=ReleaseXP') + else + status = system('msbuild /p:Configuration=Release') + end unless status - puts 'Looks like the build failied' + puts 'Looks like the build failed' exit(1) end end diff --git a/launcher/CmderLauncher.sln b/launcher/CmderLauncher.sln index e4934d3..87a82bd 100644 --- a/launcher/CmderLauncher.sln +++ b/launcher/CmderLauncher.sln @@ -1,6 +1,6 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 +# Visual Studio Express 2013 for Windows Desktop VisualStudioVersion = 12.0.21005.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CmderLauncher", "CmderLauncher.vcxproj", "{4A8485A5-B7DD-4C44-B7F6-3E2765DD0CD3}" @@ -8,13 +8,19 @@ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 + DebugXP|Win32 = DebugXP|Win32 Release|Win32 = Release|Win32 + ReleaseXP|Win32 = ReleaseXP|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {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}.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.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 GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/launcher/CmderLauncher.vcxproj b/launcher/CmderLauncher.vcxproj index f4ab5c3..1c860bc 100644 --- a/launcher/CmderLauncher.vcxproj +++ b/launcher/CmderLauncher.vcxproj @@ -1,10 +1,18 @@  + + DebugXP + Win32 + Debug Win32 + + ReleaseXP + Win32 + Release Win32 @@ -22,6 +30,12 @@ v120 Unicode + + Application + true + v120_xp + Unicode + Application false @@ -29,24 +43,45 @@ true Unicode + + Application + false + v120_xp + true + Unicode + + + + + + + true Cmder + + true + Cmder + false Cmder + + false + Cmder + @@ -61,6 +96,20 @@ true + + + + + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;XP;%(PreprocessorDefinitions) + true + + + Windows + true + + Level3 @@ -83,6 +132,28 @@ copy $(TargetPath) $(SolutionDir)..\$(TargetFileName) + + + Level3 + + + MinSpace + true + false + WIN32;NDEBUG;_WINDOWS;XP;%(PreprocessorDefinitions) + true + Size + + + Windows + true + true + true + + + copy $(TargetPath) $(SolutionDir)..\$(TargetFileName) + + diff --git a/launcher/src/CmderLauncher.cpp b/launcher/src/CmderLauncher.cpp index 677ee13..e9d6905 100644 --- a/launcher/src/CmderLauncher.cpp +++ b/launcher/src/CmderLauncher.cpp @@ -192,8 +192,13 @@ void UnregisterShellMenu(std::wstring opt) FAIL_ON_ERROR( RegCreateKeyEx(root, SHELL_MENU_REGISTRY_PATH, 0, 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(RegDeleteKey(root, SHELL_MENU_REGISTRY_PATH)); +#endif RegCloseKey(cmderKey); RegCloseKey(root); }