diff --git a/.gitignore b/.gitignore index 8719d1c..e07f9d2 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ vendor/* config/.history Thumbs.db *.exe +build/ \ No newline at end of file diff --git a/Cmder.exe b/Cmder.exe index 4bb4df1..cf73c3b 100644 Binary files a/Cmder.exe and b/Cmder.exe differ diff --git a/launcher/CmderLauncher.sln b/launcher/CmderLauncher.sln index 87a82bd..e130cc2 100644 --- a/launcher/CmderLauncher.sln +++ b/launcher/CmderLauncher.sln @@ -8,19 +8,13 @@ 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 1c860bc..f4ab5c3 100644 --- a/launcher/CmderLauncher.vcxproj +++ b/launcher/CmderLauncher.vcxproj @@ -1,18 +1,10 @@  - - DebugXP - Win32 - Debug Win32 - - ReleaseXP - Win32 - Release Win32 @@ -30,12 +22,6 @@ v120 Unicode - - Application - true - v120_xp - Unicode - Application false @@ -43,45 +29,24 @@ true Unicode - - Application - false - v120_xp - true - Unicode - - - - - - - true Cmder - - true - Cmder - false Cmder - - false - Cmder - @@ -96,20 +61,6 @@ true - - - - - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;XP;%(PreprocessorDefinitions) - true - - - Windows - true - - Level3 @@ -132,28 +83,6 @@ 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 b1055da..fcdeb60 100644 --- a/launcher/src/CmderLauncher.cpp +++ b/launcher/src/CmderLauncher.cpp @@ -12,6 +12,8 @@ #define USE_TASKBAR_API (_WIN32_WINNT >= _WIN32_WINNT_WIN7) +#define XP (_WIN32_WINNT < _WIN32_WINNT_VISTA) + #define MB_TITLE L"Cmder Launcher" #define SHELL_MENU_REGISTRY_PATH_BACKGROUND L"Directory\\Background\\shell\\Cmder" #define SHELL_MENU_REGISTRY_PATH_LISTITEM L"Directory\\shell\\Cmder" @@ -205,12 +207,10 @@ void UnregisterShellMenu(std::wstring opt, wchar_t* keyBaseName) FAIL_ON_ERROR( RegCreateKeyEx(root, keyBaseName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &cmderKey, NULL)); -#ifdef XP +#if 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)); + FAIL_ON_ERROR(RegDeleteTree(cmderKey, NULL)); #endif RegCloseKey(cmderKey); RegCloseKey(root); diff --git a/scripts/build.ps1 b/scripts/build.ps1 index b0e636f..f4a908e 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -37,8 +37,11 @@ Param( # Path to the vendor configuration source file [string]$sourcesPath = "..\vendor\sources.json", - # Vendor folder locaton - [string]$saveTo = "..\vendor\" + # Vendor folder location + [string]$saveTo = "..\vendor\", + + # Launcher folder location + [string]$launcher = "..\launcher" ) . "$PSScriptRoot\utils.ps1" @@ -68,4 +71,9 @@ foreach ($s in $sources) { } Pop-Location -Write-Verbose "All good and done!" \ No newline at end of file + +Push-Location -Path $launcher +msbuild CmderLauncher.vcxproj /p:configuration=Release +Pop-Location + +Write-Verbose "All good and done!" diff --git a/scripts/pack.ps1 b/scripts/pack.ps1 index 9d3a32b..78e8af7 100644 --- a/scripts/pack.ps1 +++ b/scripts/pack.ps1 @@ -37,6 +37,7 @@ Param( . "$PSScriptRoot\utils.ps1" $ErrorActionPreference = "Stop" +Ensure-Executable "7z" $targets = @{ "cmder.zip" = $null; diff --git a/scripts/utils.ps1 b/scripts/utils.ps1 index 4b5165b..2835ac9 100644 --- a/scripts/utils.ps1 +++ b/scripts/utils.ps1 @@ -1,17 +1,13 @@ -function Ensure-Exists ($path) { - if (-not (Test-Path $path)) { - Write-Error "Missing required $path! Ensure it is installed" - exit 1 - } - return $true > $null -} - function Ensure-Executable ($command) { try { Get-Command $command -ErrorAction Stop > $null } catch { - if( ($command -eq "7z") -and (Ensure-Exists "$env:programfiles\7-zip\7z.exe") ){ + If( ($command -eq "7z") -and (Test-Path "$env:programfiles\7-zip\7z.exe") ){ set-alias -Name "7z" -Value "$env:programfiles\7-zip\7z.exe" -Scope script - } else { + } + ElseIf( ($command -eq "7z") -and (Test-Path "$env:programw6432\7-zip\7z.exe") ) { + set-alias -Name "7z" -Value "$env:programw6432\7-zip\7z.exe" -Scope script + } + Else { Write-Error "Missing $command! Ensure it is installed and on in the PATH" exit 1 }