mirror of
https://github.com/cmderdev/cmder.git
synced 2025-07-17 04:59:09 +08:00
Compare commits
29 Commits
developmen
...
vagrant+pa
Author | SHA1 | Date | |
---|---|---|---|
396a9a0890 | |||
1ad836b288 | |||
320f928830 | |||
e0915777c0 | |||
23d3add2d1 | |||
1c399c470f | |||
65d6ecb9f1 | |||
5cb8705f65 | |||
aa56c778cb | |||
eae0a22782 | |||
2a62a045d9 | |||
b4ed3bac6d | |||
739dcb1f8c | |||
ce69566201 | |||
ffda6f70f7 | |||
95c833204f | |||
5d270b477c | |||
91939db852 | |||
e8d5528e5e | |||
0aad7daca3 | |||
80888644cc | |||
600552f061 | |||
bc0db6a7b6 | |||
eb2444d04a | |||
f318bcc1b5 | |||
c56559873c | |||
e33713a93f | |||
324aaf74f2 | |||
d73f9592d8 |
61
.github/workflows/build.yml
vendored
61
.github/workflows/build.yml
vendored
@ -11,7 +11,7 @@ on:
|
||||
tags:
|
||||
- "v*"
|
||||
pull_request:
|
||||
branches: [ "master", "development" ]
|
||||
branches: [ "master" ]
|
||||
|
||||
#---------------------------------#
|
||||
# environment configuration #
|
||||
@ -40,93 +40,50 @@ jobs:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Add MSBuild to PATH
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
uses: microsoft/setup-msbuild@v1
|
||||
|
||||
- name: Build Cmder Launcher
|
||||
shell: pwsh
|
||||
working-directory: scripts
|
||||
run: .\build.ps1 -Compile -verbose -terminal all
|
||||
run: .\build.ps1 -Compile -verbose
|
||||
|
||||
- name: Pack the built files
|
||||
shell: pwsh
|
||||
working-directory: scripts
|
||||
run: .\pack.ps1 -verbose -terminal all
|
||||
|
||||
- name: Upload artifact (cmder_win_mini.zip)
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
path: build/cmder_win_mini.zip
|
||||
name: cmder_win_mini.zip
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload artifact (cmder_win.7z)
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
path: build/cmder_win.7z
|
||||
name: cmder_win.7z
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload artifact (cmder_win.zip)
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
path: build/cmder_win.zip
|
||||
name: cmder_win.zip
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload artifact (cmder_wt.zip)
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
path: build/cmder_wt.zip
|
||||
name: cmder_wt.zip
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload artifact (cmder_wt.7z)
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
path: build/cmder_wt.7z
|
||||
name: cmder_wt.7z
|
||||
|
||||
- name: Upload artifact (cmder_wt_mini.zip)
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
path: build/cmder_wt_mini.zip
|
||||
name: cmder_wt_mini.zip
|
||||
run: .\pack.ps1 -verbose
|
||||
|
||||
- name: Upload artifact (cmder.zip)
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
path: build/cmder.zip
|
||||
name: cmder.zip
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload artifact (cmder.7z)
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
path: build/cmder.7z
|
||||
name: cmder.7z
|
||||
|
||||
- name: Upload artifact (cmder_mini.zip)
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
path: build/cmder_mini.zip
|
||||
name: cmder_mini.zip
|
||||
|
||||
- name: Upload artifact (hashes.txt)
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
path: build/hashes.txt
|
||||
name: hashes.txt
|
||||
|
||||
- name: Create Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: |
|
||||
build/cmder.zip
|
||||
build/cmder_wt.zip
|
||||
build/cmder.7z
|
||||
build/cmder_wt.7z
|
||||
build/cmder_mini.zip
|
||||
build/cmder_wt_mini.zip
|
||||
build/hashes.txt
|
||||
draft: true
|
||||
generate_release_notes: true
|
||||
|
10
.github/workflows/codeql.yml
vendored
10
.github/workflows/codeql.yml
vendored
@ -8,7 +8,7 @@ name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "master", "development" ]
|
||||
branches: [ "master" ]
|
||||
paths-ignore:
|
||||
- '**/*.md'
|
||||
- '**/*.txt'
|
||||
@ -16,7 +16,7 @@ on:
|
||||
- '**/.gitignore'
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [ "master", "development" ]
|
||||
branches: [ "master" ]
|
||||
paths-ignore:
|
||||
- '**/*.md'
|
||||
- '**/*.txt'
|
||||
@ -49,7 +49,7 @@ jobs:
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v3
|
||||
uses: github/codeql-action/init@v2
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
@ -60,7 +60,7 @@ jobs:
|
||||
# queries: security-extended,security-and-quality
|
||||
|
||||
- name: Add MSBuild to PATH
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
uses: microsoft/setup-msbuild@v1
|
||||
|
||||
- name: Build Cmder Launcher
|
||||
shell: pwsh
|
||||
@ -68,6 +68,6 @@ jobs:
|
||||
run: .\build.ps1 -Compile -verbose
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v3
|
||||
uses: github/codeql-action/analyze@v2
|
||||
with:
|
||||
category: "/language:${{matrix.language}}"
|
||||
|
2
.github/workflows/tests.yml
vendored
2
.github/workflows/tests.yml
vendored
@ -4,7 +4,6 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- development
|
||||
paths-ignore:
|
||||
- '**/*.md'
|
||||
- '**/*.txt'
|
||||
@ -13,7 +12,6 @@ on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
- development
|
||||
paths-ignore:
|
||||
- '**/*.md'
|
||||
- '**/*.txt'
|
||||
|
2
.github/workflows/vendor.yml
vendored
2
.github/workflows/vendor.yml
vendored
@ -51,7 +51,7 @@ jobs:
|
||||
Set-GHVariable -Name LIST_UPDATED -Value $listUpdated.Trim(', ')
|
||||
echo "UPDATE_MESSAGE<<<EOF`n$updateMessage`n<EOF" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
|
||||
|
||||
- uses: peter-evans/create-pull-request@v7
|
||||
- uses: peter-evans/create-pull-request@v5
|
||||
if: env.COUNT_UPDATED > 0
|
||||
with:
|
||||
title: 'Updates to `${{ env.COUNT_UPDATED }}` vendored dependencies'
|
||||
|
12
CHANGELOG.md
12
CHANGELOG.md
@ -1,17 +1,5 @@
|
||||
# Change Log
|
||||
|
||||
## Unreleased
|
||||
|
||||
### Fixes
|
||||
|
||||
- Fixes #2940
|
||||
|
||||
### Adds
|
||||
|
||||
- Cmder for Windows
|
||||
- Uses Windows and Git for Windows Native Terminals.
|
||||
- Does not contain a terminal emulator like ConEmu or Windows Terminal.
|
||||
|
||||
## [1.3.20](https://github.com/cmderdev/cmder/tree/v1.3.20) (2022-03-18)
|
||||
|
||||
### Changes
|
||||
|
74
Cmder.bat
74
Cmder.bat
@ -1,66 +1,20 @@
|
||||
@echo off
|
||||
|
||||
SET CMDER_ROOT=%~dp0
|
||||
|
||||
set CMDER_TERMINAL=conemu
|
||||
if exist "%CMDER_ROOT%\vendor\windows-terminal\windowsterminal.exe" (
|
||||
SET CMDER_TERMINAL=windows-terminal
|
||||
)
|
||||
|
||||
if NOT "%~1" == "" (
|
||||
SET CMDER_TERMINAL=%~1
|
||||
shift
|
||||
)
|
||||
|
||||
:: Remove Trailing '\'
|
||||
if "%CMDER_ROOT:~-1%" == "\" SET CMDER_ROOT=%CMDER_ROOT:~0,-1%
|
||||
|
||||
if not exist "%CMDER_ROOT%\config" md "%CMDER_ROOT%\config" 2>nul
|
||||
|
||||
call :%CMDER_TERMINAL%
|
||||
exit /b
|
||||
|
||||
:conemu
|
||||
if not exist "%CMDER_ROOT%\config\user_ConEmu.xml" (
|
||||
copy "%CMDER_ROOT%\vendor\ConEmu.xml.default" "%CMDER_ROOT%\config\user_ConEmu.xml" 1>nul
|
||||
if %errorlevel% neq 0 (
|
||||
echo ERROR: CMDER Initialization has Failed
|
||||
exit /b 1
|
||||
)
|
||||
)
|
||||
|
||||
if exist "%~1" (
|
||||
start %cmder_root%\vendor\conemu-maximus5\ConEmu.exe /Icon "%CMDER_ROOT%\icons\cmder.ico" /Title Cmder /LoadCfgFile "%~1"
|
||||
) else (
|
||||
start %cmder_root%\vendor\conemu-maximus5\ConEmu.exe /Icon "%CMDER_ROOT%\icons\cmder.ico" /Title Cmder /LoadCfgFile "%CMDER_ROOT%\config\user_ConEmu.xml"
|
||||
)
|
||||
exit /b
|
||||
|
||||
:windows-terminal
|
||||
if not exist "%CMDER_ROOT%\vendor\windows-terminal\settings" md "%CMDER_ROOT%\vendor\windows-terminal\settings" 2>nul
|
||||
if not exist "%CMDER_ROOT%\vendor\windows-terminal\.portable" echo "This makes this installation of Windows Terminal portable" >"%CMDER_ROOT%\vendor\windows-terminal\.portable" 2>nul
|
||||
|
||||
if exist "%CMDER_ROOT%\config\user_windows_terminal_settings.json" (
|
||||
if not exist "%CMDER_ROOT%\vendor\windows-terminal\settings\settings.json" (
|
||||
echo "Copying user Windows Terminal settings to '%CMDER_ROOT%\vendor\windows-terminal\settings\settings.json'..."
|
||||
copy "%CMDER_ROOT%\config\user_windows_terminal_settings.json" "%CMDER_ROOT%\vendor\windows-terminal\settings\settings.json" 1>nul
|
||||
)
|
||||
) else if not exist "%CMDER_ROOT%\config\user_windows_terminal_settings.json" (
|
||||
if not exist "%CMDER_ROOT%\config" mkdir "%CMDER_ROOT%\config" 2>nul
|
||||
echo "Copying default Windows Terminal settings to '%CMDER_ROOT%\config'..."
|
||||
copy "%CMDER_ROOT%\vendor\windows_terminal_default_settings.json" "%CMDER_ROOT%\config\user_windows_terminal_settings.json" 1>nul
|
||||
echo "Copying default Windows Terminal settings to '%CMDER_ROOT%\vendor\windows-terminal\settings\settings.json'..."
|
||||
copy "%CMDER_ROOT%\vendor\windows_terminal_default_settings.json" "%CMDER_ROOT%\vendor\windows-terminal\settings\settings.json" 1>nul
|
||||
|
||||
if %errorlevel% neq 0 (
|
||||
echo ERROR: CMDER Initialization has Failed
|
||||
exit /b 1
|
||||
)
|
||||
) else if exist "%cmder_root%\vendor\windows-terminal\settings\settings.json" (
|
||||
copy "%cmder_root%\vendor\windows-terminal\settings\settings.json" "%CMDER_ROOT%\config\user_windows_terminal_settings.json"
|
||||
)
|
||||
|
||||
start %cmder_root%\vendor\windows-terminal\windowsterminal.exe
|
||||
exit /b
|
||||
@if "%CMDER_ROOT:~-1%" == "\" SET CMDER_ROOT=%CMDER_ROOT:~0,-1%
|
||||
|
||||
if not exist "%CMDER_ROOT%\config\user_ConEmu.xml" (
|
||||
if not exist "%CMDER_ROOT%\config" mkdir "%CMDER_ROOT%\config" 2>nul
|
||||
copy "%CMDER_ROOT%\vendor\ConEmu.xml.default" "%CMDER_ROOT%\config\user_ConEmu.xml" 1>nul
|
||||
if %errorlevel% neq 0 (
|
||||
echo ERROR: CMDER Initialization has Failed
|
||||
exit /b 1
|
||||
)
|
||||
)
|
||||
|
||||
if exist "%~1" (
|
||||
start %~dp0/vendor/conemu-maximus5/ConEmu.exe /Icon "%CMDER_ROOT%\icons\cmder.ico" /Title Cmder /LoadCfgFile "%~1"
|
||||
) else (
|
||||
start %~dp0/vendor/conemu-maximus5/ConEmu.exe /Icon "%CMDER_ROOT%\icons\cmder.ico" /Title Cmder /LoadCfgFile "%CMDER_ROOT%\config\user_ConEmu.xml"
|
||||
)
|
||||
|
@ -60,7 +60,7 @@ The Cmder's user interface is also designed to be more eye pleasing, and you can
|
||||
| `/SINGLE` | Start Cmder in single mode. |
|
||||
| `/START [start_path]` | Folder path to start in. |
|
||||
| `/TASK [task_name]` | Task to start after launch. |
|
||||
| `-- [ConEmu extras pars]` | Forwards ALL remaining parameters to ConEmu. |
|
||||
| `/X [ConEmu extras pars]` | Forwards parameters to ConEmu |
|
||||
|
||||
## Context Menu Integration
|
||||
|
||||
|
66
Vagrantfile
vendored
Normal file
66
Vagrantfile
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
required_plugins = %w( vagrant-vbguest )
|
||||
required_plugins.each do |plugin|
|
||||
unless Vagrant.has_plugin? plugin
|
||||
system "vagrant plugin install #{plugin}"
|
||||
p "Run 'vagrant up' again to continue."
|
||||
exit 0
|
||||
end
|
||||
end
|
||||
|
||||
Vagrant.configure("2") do |config|
|
||||
# config.vbguest.iso_path = "../../../../usr/share/virtualbox/VBoxGuestAdditions.iso"
|
||||
config.vbguest.allow_downgrade = true
|
||||
|
||||
config.vm.define "cmderdev-10" do |b|
|
||||
b.vm.hostname = "cmderdev-10"
|
||||
b.vm.box = "dgames/cmderdev-10"
|
||||
b.vm.box_version = "1.0.0"
|
||||
|
||||
b.vm.provider :virtualbox do |v|
|
||||
# v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
|
||||
v.customize ["modifyvm", :id, "--name", "cmderdev-10"]
|
||||
v.customize ["modifyvm", :id, "--ostype", "Windows10_64"]
|
||||
v.customize ["modifyvm", :id, "--graphicscontroller", "vboxsvga"]
|
||||
v.customize ["modifyvm", :id, "--memory", 2048]
|
||||
v.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
|
||||
end
|
||||
end
|
||||
|
||||
config.vm.define "cmderdev-10s" do |b|
|
||||
b.vm.hostname = 'cmderdev-10'
|
||||
b.vm.box = "dgames/cmderdev-10"
|
||||
b.vm.box_version = "1.0.0"
|
||||
|
||||
b.vm.provider :virtualbox do |v|
|
||||
# v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
|
||||
v.customize ["modifyvm", :id, "--name", "cmderdev-10s"]
|
||||
v.customize ["modifyvm", :id, "--ostype", "Windows10_64"]
|
||||
v.customize ["modifyvm", :id, "--graphicscontroller", "vboxsvga"]
|
||||
v.customize ["modifyvm", :id, "--memory", 2048]
|
||||
v.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
|
||||
v.customize ["setextradata", :id, "GUI/ScaleFactor", "1.75"]
|
||||
end
|
||||
end
|
||||
|
||||
config.vm.define "cmderdev-11" do |b|
|
||||
b.vm.box = "dgames/cmderdev-11"
|
||||
b.vm.box_version = "1.0.0"
|
||||
|
||||
b.vm.provider :virtualbox do |v|
|
||||
# v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
|
||||
v.customize ["modifyvm", :id, "--name", "cmderdev-11"]
|
||||
v.customize ["modifyvm", :id, "--ostype", "Windows11_64"]
|
||||
v.customize ["modifyvm", :id, "--graphicscontroller", "vboxvga"]
|
||||
v.customize ["modifyvm", :id, "--memory", 4096]
|
||||
v.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
|
||||
end
|
||||
end
|
||||
|
||||
config.vm.provision "file", source: "./scripts/vagrant/windows_terminal_settings.json.default", destination: "windows_terminal_settings.json.default"
|
||||
config.vm.provision "file", source: "./scripts/vagrant/windows_terminal_state.json.default", destination: "windows_terminal_state.json.default"
|
||||
config.vm.provision "file", source: "./vendor/bin/set-shortcut.ps1", destination: "c:\\windows\\set-shortcut.ps1"
|
||||
config.vm.provision "shell", path: './scripts/vagrant/add-cmder.ps1'
|
||||
config.vm.provision "shell", path: './vendor/bin/add-vscodeprofile.ps1'
|
||||
config.vm.provision "shell", path: './vendor/bin/add-windowsterminalprofiles.ps1'
|
||||
config.vm.provision "shell", path: './vendor/bin/add-cmdertodesktop.ps1'
|
||||
end
|
@ -188,9 +188,6 @@
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\CmderLauncher.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="..\icons\cmder.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
|
@ -107,9 +107,9 @@ bool FileExists(const wchar_t * filePath)
|
||||
|
||||
void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstring taskName = L"", std::wstring title = L"", std::wstring iconPath = L"", std::wstring cfgRoot = L"", bool use_user_cfg = true, std::wstring conemu_args = L"")
|
||||
{
|
||||
#if USE_TASKBAR_API
|
||||
wchar_t appId[MAX_PATH] = { 0 };
|
||||
#endif
|
||||
#if USE_TASKBAR_API
|
||||
wchar_t appId[MAX_PATH] = { 0 };
|
||||
#endif
|
||||
wchar_t exeDir[MAX_PATH] = { 0 };
|
||||
wchar_t icoPath[MAX_PATH] = { 0 };
|
||||
wchar_t cfgPath[MAX_PATH] = { 0 };
|
||||
@ -117,7 +117,7 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
||||
wchar_t cpuCfgPath[MAX_PATH] = { 0 };
|
||||
wchar_t userCfgPath[MAX_PATH] = { 0 };
|
||||
wchar_t defaultCfgPath[MAX_PATH] = { 0 };
|
||||
wchar_t terminalPath[MAX_PATH] = { 0 };
|
||||
wchar_t conEmuPath[MAX_PATH] = { 0 };
|
||||
wchar_t configDirPath[MAX_PATH] = { 0 };
|
||||
wchar_t userConfigDirPath[MAX_PATH] = { 0 };
|
||||
wchar_t userBinDirPath[MAX_PATH] = { 0 };
|
||||
@ -128,34 +128,21 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
||||
wchar_t legacyUserAliasesPath[MAX_PATH] = { 0 };
|
||||
wchar_t args[MAX_PATH * 2 + 256] = { 0 };
|
||||
wchar_t userConEmuCfgPath[MAX_PATH] = { 0 };
|
||||
wchar_t windowsTerminalDir[MAX_PATH] = { 0 };
|
||||
wchar_t conEmuDir[MAX_PATH] = { 0 };
|
||||
wchar_t winDir[MAX_PATH] = { 0 };
|
||||
wchar_t vendorDir[MAX_PATH] = { 0 };
|
||||
wchar_t initCmd[MAX_PATH] = { 0 };
|
||||
wchar_t initPowerShell[MAX_PATH] = { 0 };
|
||||
wchar_t initBash[MAX_PATH] = { 0 };
|
||||
wchar_t initMintty[MAX_PATH] = { 0 };
|
||||
wchar_t vendoredGit[MAX_PATH] = { 0 };
|
||||
wchar_t amdx64Git[MAX_PATH] = { 0 };
|
||||
wchar_t x86Git[MAX_PATH] = { 0 };
|
||||
wchar_t programFiles[MAX_PATH] = { 0 };
|
||||
wchar_t programFilesX86[MAX_PATH] = { 0 };
|
||||
wchar_t minTTYPath[MAX_PATH] = { 0 };
|
||||
|
||||
|
||||
std::wstring cmderStart = path;
|
||||
std::wstring cmderTask = taskName;
|
||||
std::wstring cmderTitle = title;
|
||||
std::wstring cmderTerminalArgs = conemu_args;
|
||||
std::wstring cmderConEmuArgs = conemu_args;
|
||||
|
||||
std::copy(cfgRoot.begin(), cfgRoot.end(), userConfigDirPath);
|
||||
userConfigDirPath[cfgRoot.length()] = 0;
|
||||
|
||||
GetModuleFileName(NULL, exeDir, sizeof(exeDir));
|
||||
|
||||
#if USE_TASKBAR_API
|
||||
wcscpy_s(appId, exeDir);
|
||||
#endif
|
||||
#if USE_TASKBAR_API
|
||||
wcscpy_s(appId, exeDir);
|
||||
#endif
|
||||
|
||||
PathRemoveFileSpec(exeDir);
|
||||
|
||||
@ -179,8 +166,8 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
||||
{
|
||||
PathCombine(userProfilePath, configDirPath, L"user_profile.cmd");
|
||||
|
||||
char* lPr = (char*)malloc(MAX_PATH);
|
||||
char* pR = (char*)malloc(MAX_PATH);
|
||||
char *lPr = (char *)malloc(MAX_PATH);
|
||||
char *pR = (char *)malloc(MAX_PATH);
|
||||
size_t i;
|
||||
wcstombs_s(&i, lPr, (size_t)MAX_PATH,
|
||||
legacyUserProfilePath, (size_t)MAX_PATH);
|
||||
@ -197,8 +184,8 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
||||
{
|
||||
PathCombine(userAliasesPath, configDirPath, L"user_aliases.cmd");
|
||||
|
||||
char* lPr = (char*)malloc(MAX_PATH);
|
||||
char* pR = (char*)malloc(MAX_PATH);
|
||||
char *lPr = (char *)malloc(MAX_PATH);
|
||||
char *pR = (char *)malloc(MAX_PATH);
|
||||
size_t i;
|
||||
wcstombs_s(&i, lPr, (size_t)MAX_PATH,
|
||||
legacyUserAliasesPath, (size_t)MAX_PATH);
|
||||
@ -235,8 +222,8 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
||||
{
|
||||
PathCombine(userProfilePath, userConfigDirPath, L"user_profile.cmd");
|
||||
|
||||
char* lPr = (char*)malloc(MAX_PATH);
|
||||
char* pR = (char*)malloc(MAX_PATH);
|
||||
char *lPr = (char *)malloc(MAX_PATH);
|
||||
char *pR = (char *)malloc(MAX_PATH);
|
||||
size_t i;
|
||||
wcstombs_s(&i, lPr, (size_t)MAX_PATH,
|
||||
legacyUserProfilePath, (size_t)MAX_PATH);
|
||||
@ -253,8 +240,8 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
||||
{
|
||||
PathCombine(userAliasesPath, userConfigDirPath, L"user_aliases.cmd");
|
||||
|
||||
char* lPr = (char*)malloc(MAX_PATH);
|
||||
char* pR = (char*)malloc(MAX_PATH);
|
||||
char *lPr = (char *)malloc(MAX_PATH);
|
||||
char *pR = (char *)malloc(MAX_PATH);
|
||||
size_t i;
|
||||
wcstombs_s(&i, lPr, (size_t)MAX_PATH,
|
||||
legacyUserAliasesPath, (size_t)MAX_PATH);
|
||||
@ -264,158 +251,71 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
||||
}
|
||||
}
|
||||
|
||||
PathCombine(vendorDir, exeDir, L"vendor");
|
||||
PathCombine(windowsTerminalDir, vendorDir, L"windows-terminal");
|
||||
PathCombine(conEmuDir, vendorDir, L"conemu-maximus5");
|
||||
GetEnvironmentVariable(L"WINDIR", winDir, MAX_PATH);
|
||||
// Set path to vendored ConEmu config file
|
||||
PathCombine(cfgPath, exeDir, L"vendor\\conemu-maximus5\\ConEmu.xml");
|
||||
|
||||
if (PathFileExists(windowsTerminalDir))
|
||||
{
|
||||
// Set path to vendored ConEmu config file
|
||||
PathCombine(cfgPath, windowsTerminalDir, L"settings\\settings.json");
|
||||
// Set path to Cmder default ConEmu config file
|
||||
PathCombine(defaultCfgPath, exeDir, L"vendor\\ConEmu.xml.default");
|
||||
|
||||
// Set path to Cmder default ConEmu config file
|
||||
PathCombine(defaultCfgPath, exeDir, L"vendor\\windows_terminal_default_settings.json");
|
||||
// Check for machine-specific then user config source file.
|
||||
PathCombine(cpuCfgPath, userConfigDirPath, L"ConEmu-%COMPUTERNAME%.xml");
|
||||
ExpandEnvironmentStrings(cpuCfgPath, cpuCfgPath, sizeof(cpuCfgPath) / sizeof(cpuCfgPath[0]));
|
||||
|
||||
// Check for machine-specific then user config source file.
|
||||
PathCombine(cpuCfgPath, userConfigDirPath, L"windows_terminal_%COMPUTERNAME%_settings.json");
|
||||
ExpandEnvironmentStrings(cpuCfgPath, cpuCfgPath, sizeof(cpuCfgPath) / sizeof(cpuCfgPath[0]));
|
||||
// Set path to Cmder user ConEmu config file
|
||||
PathCombine(userCfgPath, userConfigDirPath, L"user-ConEmu.xml");
|
||||
|
||||
// Set path to Cmder user ConEmu config file
|
||||
PathCombine(userCfgPath, userConfigDirPath, L"user_windows_terminal_settings.json");
|
||||
}
|
||||
else if (PathFileExists(conEmuDir))
|
||||
{
|
||||
// Set path to vendored ConEmu config file
|
||||
PathCombine(cfgPath, conEmuDir, L"ConEmu.xml");
|
||||
|
||||
// Set path to Cmder default ConEmu config file
|
||||
PathCombine(defaultCfgPath, exeDir, L"vendor\\ConEmu.xml.default");
|
||||
|
||||
// Check for machine-specific then user config source file.
|
||||
PathCombine(cpuCfgPath, userConfigDirPath, L"ConEmu-%COMPUTERNAME%.xml");
|
||||
ExpandEnvironmentStrings(cpuCfgPath, cpuCfgPath, sizeof(cpuCfgPath) / sizeof(cpuCfgPath[0]));
|
||||
|
||||
// Set path to Cmder user ConEmu config file
|
||||
PathCombine(userCfgPath, userConfigDirPath, L"user-ConEmu.xml");
|
||||
}
|
||||
|
||||
if (wcscmp(cpuCfgPath, L"") != 0 && (PathFileExists(cpuCfgPath) || use_user_cfg == false)) // config/[host specific terminal emulator config] file exists or /m was specified on command line, use machine specific config.
|
||||
if ( PathFileExists(cpuCfgPath) || use_user_cfg == false ) // config/ConEmu-%COMPUTERNAME%.xml file exists or /m was specified on command line, use machine specific config.
|
||||
{
|
||||
if (cfgRoot.length() == 0) // '/c [path]' was NOT specified
|
||||
{
|
||||
if (PathFileExists(cfgPath)) // [terminal emulator config] file exists, copy [terminal emulator config] to config/user_[terminal emulator config] file to backup any settings changes from previous sessions.
|
||||
if (PathFileExists(cfgPath)) // vendor/conemu-maximus5/ConEmu.xml file exists, copy vendor/conemu-maximus5/ConEmu.xml to config/ConEmu-%COMPUTERNAME%.xml.
|
||||
{
|
||||
if (!CopyFile(cfgPath, cpuCfgPath, FALSE))
|
||||
{
|
||||
if (PathFileExists(windowsTerminalDir)) {
|
||||
MessageBox(NULL,
|
||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||
? L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/windows_terminal_%COMPUTERNAME%_settings.json! Access Denied."
|
||||
: L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/windows_teerminal_%COMPUTERNAME%_settigns.json!", MB_TITLE, MB_ICONSTOP);
|
||||
exit(1);
|
||||
}
|
||||
else if (PathFileExists(conEmuDir))
|
||||
{
|
||||
MessageBox(NULL,
|
||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||
? L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/ConEmu-%COMPUTERNAME%.xml! Access Denied."
|
||||
: L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/ConEmu-%COMPUTERNAME%.xml!", MB_TITLE, MB_ICONSTOP);
|
||||
exit(1);
|
||||
}
|
||||
MessageBox(NULL,
|
||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||
? L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/ConEmu-%COMPUTERNAME%.xml! Access Denied."
|
||||
: L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/ConEmu-%COMPUTERNAME%.xml!", MB_TITLE, MB_ICONSTOP);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
else // [terminal emulator config] file does not exist, copy config/[host specific terminal emulator config] file to [terminal emulator config] file
|
||||
else // vendor/conemu-maximus5/ConEmu.xml config file does not exist, copy config/ConEmu-%COMPUTERNAME%.xml to vendor/conemu-maximus5/ConEmu.xml file
|
||||
{
|
||||
if (!CopyFile(cpuCfgPath, cfgPath, FALSE))
|
||||
{
|
||||
if (PathFileExists(windowsTerminalDir)) {
|
||||
MessageBox(NULL,
|
||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||
? L"Failed to copy config/windows_terminal_%COMPUTERNAME%_settings.json file to vendor/windows-terminal/settings/settings.json! Access Denied."
|
||||
: L"Failed to copy config/windows_terminal_%COMPUTERNAME%_settings.json file to vendor/windows-terminal/settings/settings.json!", MB_TITLE, MB_ICONSTOP);
|
||||
exit(1);
|
||||
}
|
||||
else if (PathFileExists(conEmuDir))
|
||||
{
|
||||
MessageBox(NULL,
|
||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||
? L"Failed to copy config/ConEmu-%COMPUTERNAME%.xml file to vendor/conemu-maximus5/ConEmu.xml! Access Denied."
|
||||
: L"Failed to copy config/ConEmu-%COMPUTERNAME%.xml file to vendor/conemu-maximus5/ConEmu.xml!", MB_TITLE, MB_ICONSTOP);
|
||||
exit(1);
|
||||
}
|
||||
MessageBox(NULL,
|
||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||
? L"Failed to copy config/ConEmu-%COMPUTERNAME%.xml file to vendor/conemu-maximus5/ConEmu.xml! Access Denied."
|
||||
: L"Failed to copy config/ConEmu-%COMPUTERNAME%.xml file to vendor/conemu-maximus5/ConEmu.xml!", MB_TITLE, MB_ICONSTOP);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (wcscmp(userCfgPath, L"") != 0 && PathFileExists(userCfgPath)) // config/user[terminal emulator config] file exists, use it.
|
||||
{
|
||||
if (cfgRoot.length() == 0) // '/c [path]' was NOT specified
|
||||
else // '/c [path]' was specified, don't copy anything and use existing conemu-%COMPUTERNAME%.xml to start comemu.
|
||||
{
|
||||
if (PathFileExists(cfgPath)) // [terminal emulator config] file exists, copy [terminal emulator config] to config/user_[terminal emulator config] file to backup any settings changes from previous sessions.
|
||||
if (use_user_cfg == false && PathFileExists(cfgPath) && !PathFileExists(cpuCfgPath)) // vendor/conemu-maximus5/ConEmu.xml file exists, copy vendor/conemu-maximus5/ConEmu.xml to config/ConEmu-%COMPUTERNAME%.xml.
|
||||
{
|
||||
if (!CopyFile(cfgPath, userCfgPath, FALSE))
|
||||
{
|
||||
if (PathFileExists(windowsTerminalDir))
|
||||
{
|
||||
MessageBox(NULL,
|
||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||
? L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/windows_terminal_settings.json! Access Denied."
|
||||
: L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/windows_teerminal_settigns.json!", MB_TITLE, MB_ICONSTOP);
|
||||
exit(1);
|
||||
}
|
||||
else if (PathFileExists(conEmuDir))
|
||||
{
|
||||
MessageBox(NULL,
|
||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||
? L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/user-conemu.xml! Access Denied."
|
||||
: L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/user-conemu.xml!", MB_TITLE, MB_ICONSTOP);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else // [terminal emulator config] file does not exist, copy config/user_[terminal emulator config] file to [terminal emulator config] file
|
||||
{
|
||||
if (!CopyFile(userCfgPath, cfgPath, FALSE))
|
||||
{
|
||||
if (PathFileExists(windowsTerminalDir))
|
||||
{
|
||||
MessageBox(NULL,
|
||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||
? L"Failed to copy config/user_windows_terminal_settings.json file to vendor/windows-terminal/settings/settings.json! Access Denied."
|
||||
: L"Failed to copy config/user_windows_terminal_settings.json file to vendor/windows-terminal/settings/settings.json!", MB_TITLE, MB_ICONSTOP);
|
||||
exit(1);
|
||||
}
|
||||
else if (PathFileExists(conEmuDir))
|
||||
{
|
||||
MessageBox(NULL,
|
||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||
? L"Failed to copy config/user-conemu.xml file to vendor/conemu-maximus5/ConEmu.xml! Access Denied."
|
||||
: L"Failed to copy config/user-conemu.xml file to vendor/conemu-maximus5/ConEmu.xml!", MB_TITLE, MB_ICONSTOP);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!PathFileExists(windowsTerminalDir)) { // '/c [path]' was specified, don't copy anything and use existing user_[terminal emulator config] file.
|
||||
PathCombine(userConEmuCfgPath, userConfigDirPath, L"user-ConEmu.xml");
|
||||
}
|
||||
}
|
||||
else if (cfgRoot.length() == 0) // '/c [path]' was NOT specified
|
||||
{
|
||||
if (PathFileExists(cfgPath)) // [terminal emulator config] file exists, copy [terminal emulator config] file to config/user_[terminal emulator config] file.
|
||||
{
|
||||
if (!CopyFile(cfgPath, userCfgPath, FALSE))
|
||||
{
|
||||
if (PathFileExists(windowsTerminalDir))
|
||||
if (!CopyFile(cfgPath, cpuCfgPath, FALSE))
|
||||
{
|
||||
MessageBox(NULL,
|
||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||
? L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/user_windows_terminal_settings.json! Access Denied."
|
||||
: L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/user_windows_terminal_settigns.json!", MB_TITLE, MB_ICONSTOP);
|
||||
? L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/ConEmu-%COMPUTERNAME%.xml! Access Denied."
|
||||
: L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/ConEmu-%COMPUTERNAME%.xml!", MB_TITLE, MB_ICONSTOP);
|
||||
exit(1);
|
||||
}
|
||||
else if (PathFileExists(conEmuDir))
|
||||
}
|
||||
|
||||
PathCombine(userConEmuCfgPath, userConfigDirPath, L"ConEmu-%COMPUTERNAME%.xml");
|
||||
ExpandEnvironmentStrings(userConEmuCfgPath, userConEmuCfgPath, sizeof(userConEmuCfgPath) / sizeof(userConEmuCfgPath[0]));
|
||||
}
|
||||
}
|
||||
else if (PathFileExists(userCfgPath)) // config/user_conemu.xml exists, use it.
|
||||
{
|
||||
if (cfgRoot.length() == 0) // '/c [path]' was NOT specified
|
||||
{
|
||||
if (PathFileExists(cfgPath)) // vendor/conemu-maximus5/ConEmu.xml exists, copy vendor/conemu-maximus5/ConEmu.xml to config/user_conemu.xml.
|
||||
{
|
||||
if (!CopyFile(cfgPath, userCfgPath, FALSE))
|
||||
{
|
||||
MessageBox(NULL,
|
||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||
@ -424,51 +324,28 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
else // vendor/[terminal emulator config].default config exists, copy Cmder vendor/[terminal emulator config].default file to [terminal emulator config] file.
|
||||
else // vendor/conemu-maximus5/ConEmu.xml does not exist, copy config/user-conemu.xml to vendor/conemu-maximus5/ConEmu.xml
|
||||
{
|
||||
if (!CopyFile(defaultCfgPath, cfgPath, FALSE))
|
||||
if (!CopyFile(userCfgPath, cfgPath, FALSE))
|
||||
{
|
||||
if (PathFileExists(windowsTerminalDir))
|
||||
{
|
||||
MessageBox(NULL,
|
||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||
? L"Failed to copy vendor/windows-terminal_default_settings_settings.json file to vendor/windows-terminal/settings/settings.json! Access Denied."
|
||||
: L"Failed to copy vendor/windows-terminal_default_settings_settings.json file to vendor/windows-terminal/settings/settigns.json!", MB_TITLE, MB_ICONSTOP);
|
||||
exit(1);
|
||||
}
|
||||
else if (PathFileExists(conEmuDir))
|
||||
{
|
||||
MessageBox(NULL,
|
||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||
? L"Failed to copy vendor/ConEmu.xml.default file to vendor/conemu-maximus5/ConEmu.xml! Access Denied."
|
||||
: L"Failed to copy vendor/ConEmu.xml.default file to vendor/conemu-maximus5/ConEmu.xml!", MB_TITLE, MB_ICONSTOP);
|
||||
exit(1);
|
||||
}
|
||||
MessageBox(NULL,
|
||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||
? L"Failed to copy config/user-conemu.xml file to vendor/conemu-maximus5/ConEmu.xml! Access Denied."
|
||||
: L"Failed to copy config/user-conemu.xml file to vendor/conemu-maximus5/ConEmu.xml!", MB_TITLE, MB_ICONSTOP);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!CopyFile(defaultCfgPath, cfgPath, FALSE) && PathFileExists(conEmuDir))
|
||||
else // '/c [path]' was specified, don't copy anything and use existing user_conemu.xml to start comemu.
|
||||
{
|
||||
MessageBox(NULL,
|
||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||
? L"Failed to copy vendor/ConEmu.xml.default file to vendor/conemu-maximus5/ConEmu.xml! Access Denied."
|
||||
: L"Failed to copy vendor/ConEmu.xml.default file to vendor/conemu-maximus5/ConEmu.xml!", MB_TITLE, MB_ICONSTOP);
|
||||
exit(1);
|
||||
PathCombine(userConEmuCfgPath, userConfigDirPath, L"user-ConEmu.xml");
|
||||
}
|
||||
}
|
||||
else if (wcscmp(cfgPath, L"") != 0 && PathFileExists(cfgPath)) // This is a first time Cmder.exe run and [terminal emulator config] file exists, copy [terminal emulator config] file to config/user_[terminal emulator config] file.
|
||||
else if (cfgRoot.length() == 0) // '/c [path]' was NOT specified
|
||||
{
|
||||
if (!CopyFile(cfgPath, userCfgPath, FALSE))
|
||||
if (PathFileExists(cfgPath)) // vendor/conemu-maximus5/ConEmu.xml exists, copy vendor/conemu-maximus5/ConEmu.xml to config/user_conemu.xml
|
||||
{
|
||||
if (PathFileExists(windowsTerminalDir))
|
||||
{
|
||||
MessageBox(NULL,
|
||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||
? L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/user_windows_terminal_settings_settings.json! Access Denied."
|
||||
: L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/user_windows_terminal_settings_settigns.json!", MB_TITLE, MB_ICONSTOP);
|
||||
exit(1);
|
||||
}
|
||||
else
|
||||
if (!CopyFile(cfgPath, userCfgPath, FALSE))
|
||||
{
|
||||
MessageBox(NULL,
|
||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||
@ -476,146 +353,99 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
||||
: L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/user-conemu.xml!", MB_TITLE, MB_ICONSTOP);
|
||||
exit(1);
|
||||
}
|
||||
else // vendor/ConEmu.xml.default config exists, copy Cmder vendor/ConEmu.xml.default file to vendor/conemu-maximus5/ConEmu.xml.
|
||||
{
|
||||
if (!CopyFile(defaultCfgPath, cfgPath, FALSE))
|
||||
{
|
||||
MessageBox(NULL,
|
||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||
? L"Failed to copy vendor/ConEmu.xml.default file to vendor/conemu-maximus5/ConEmu.xml! Access Denied."
|
||||
: L"Failed to copy vendor/ConEmu.xml.default file to vendor/conemu-maximus5/ConEmu.xml!", MB_TITLE, MB_ICONSTOP);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!CopyFile(defaultCfgPath, cfgPath, FALSE))
|
||||
{
|
||||
MessageBox(NULL,
|
||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||
? L"Failed to copy vendor/ConEmu.xml.default file to vendor/conemu-maximus5/ConEmu.xml! Access Denied."
|
||||
: L"Failed to copy vendor/ConEmu.xml.default file to vendor/conemu-maximus5/ConEmu.xml!", MB_TITLE, MB_ICONSTOP);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (PathFileExists(cfgPath)) // vendor/conemu-maximus5/ConEmu.xml exists, copy vendor/conemu-maximus5/ConEmu.xml to config/user_conemu.xml
|
||||
{
|
||||
if (!CopyFile(cfgPath, userCfgPath, FALSE))
|
||||
{
|
||||
MessageBox(NULL,
|
||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||
? L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/user-conemu.xml! Access Denied."
|
||||
: L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/user-conemu.xml!", MB_TITLE, MB_ICONSTOP);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
PathCombine(userConEmuCfgPath, userConfigDirPath, L"user-ConEmu.xml");
|
||||
}
|
||||
else if (wcscmp(defaultCfgPath, L"") != 0) // '/c [path]' was specified and 'vendor/[terminal emulator config].default' config exists, copy Cmder 'vendor/[terminal emulator config].default' file to '[user specified path]/config/user_[terminal emulator config]'.
|
||||
else // '/c [path]' was specified and 'vendor/ConEmu.xml.default' config exists, copy Cmder 'vendor/ConEmu.xml.default' file to '[user specified path]/config/user_ConEmu.xml'.
|
||||
{
|
||||
if ( ! CopyFile(defaultCfgPath, userCfgPath, FALSE))
|
||||
{
|
||||
if (PathFileExists(windowsTerminalDir))
|
||||
{
|
||||
MessageBox(NULL,
|
||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||
? L"Failed to copy vendor/windows-terminal_default_settings_settings.json file to [user specified path]/config/user_windows_terminal_settings.json! Access Denied."
|
||||
: L"Failed to copy vendor/windows-terminal_default_settings_settings.json file to [user specified path]/config/user_windows_terminal_settings.json!", MB_TITLE, MB_ICONSTOP);
|
||||
exit(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox(NULL,
|
||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||
? L"Failed to copy vendor/ConEmu.xml.default file to [user specified path]/config/user_ConEmu.xml! Access Denied."
|
||||
: L"Failed to copy vendor/ConEmu.xml.default file to [user specified path]/config/user_ConEmu.xml!", MB_TITLE, MB_ICONSTOP);
|
||||
exit(1);
|
||||
}
|
||||
MessageBox(NULL,
|
||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||
? L"Failed to copy vendor/ConEmu.xml.default file to [user specified path]/config/user_ConEmu.xml! Access Denied."
|
||||
: L"Failed to copy vendor/ConEmu.xml.default file to [user specified path]/config/user_ConEmu.xml!", MB_TITLE, MB_ICONSTOP);
|
||||
exit(1);
|
||||
}
|
||||
PathCombine(userConEmuCfgPath, userConfigDirPath, L"user-ConEmu.xml");
|
||||
}
|
||||
|
||||
GetEnvironmentVariable(L"ProgramFiles", programFiles, MAX_PATH);
|
||||
GetEnvironmentVariable(L"ProgramFiles(x86)", programFilesX86, MAX_PATH);
|
||||
|
||||
PathCombine(vendoredGit, vendorDir, L"git-for-windows");
|
||||
PathCombine(amdx64Git, programFiles, L"Git");
|
||||
PathCombine(x86Git, programFilesX86, L"Git");
|
||||
|
||||
SYSTEM_INFO sysInfo;
|
||||
GetNativeSystemInfo(&sysInfo);
|
||||
if (PathFileExists(windowsTerminalDir))
|
||||
if (sysInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
|
||||
{
|
||||
PathCombine(terminalPath, exeDir, L"vendor\\windows-terminal\\WindowsTerminal.exe");
|
||||
}
|
||||
else if (PathFileExists(conEmuDir))
|
||||
{
|
||||
swprintf_s(args, L"%s /Icon \"%s\"", args, icoPath);
|
||||
swprintf_s(args, L"%s /title \"%s\"", args, cmderTitle.c_str());
|
||||
PathCombine(terminalPath, exeDir, L"vendor\\conemu-maximus5\\ConEmu64.exe");
|
||||
PathCombine(conEmuPath, exeDir, L"vendor\\conemu-maximus5\\ConEmu64.exe");
|
||||
}
|
||||
else
|
||||
{
|
||||
PathCombine(terminalPath, winDir, L"system32\\cmd.exe");
|
||||
|
||||
if (streqi(cmderTask.c_str(), L"powershell"))
|
||||
{
|
||||
PathCombine(terminalPath, winDir, L"System32\\WindowsPowerShell\\v1.0\\powershell.exe");
|
||||
}
|
||||
/*
|
||||
else if (streqi(cmderTask.c_str(), L"mintty"))
|
||||
{
|
||||
if (PathFileExists(vendoredGit))
|
||||
{
|
||||
PathCombine(terminalPath, vendoredGit, L"git-bash.exe");
|
||||
}
|
||||
else if (PathFileExists(amdx64Git))
|
||||
{
|
||||
PathCombine(terminalPath, amdx64Git, L"git-bash.exe");
|
||||
}
|
||||
else if (PathFileExists(x86Git))
|
||||
{
|
||||
PathCombine(terminalPath, x86Git, L"git-bash.exe");
|
||||
}
|
||||
}
|
||||
*/
|
||||
PathCombine(conEmuPath, exeDir, L"vendor\\conemu-maximus5\\ConEmu.exe");
|
||||
}
|
||||
|
||||
swprintf_s(args, L"%s /Icon \"%s\"", args, icoPath);
|
||||
|
||||
if (!streqi(cmderStart.c_str(), L""))
|
||||
{
|
||||
if (PathFileExists(windowsTerminalDir)) {
|
||||
swprintf_s(args, L"%s -d \"%s\"", args, cmderStart.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
swprintf_s(args, L"%s /dir \"%s\"", args, cmderStart.c_str());
|
||||
}
|
||||
swprintf_s(args, L"%s /dir \"%s\"", args, cmderStart.c_str());
|
||||
}
|
||||
|
||||
if (is_single_mode)
|
||||
{
|
||||
if (!PathFileExists(windowsTerminalDir)) {
|
||||
swprintf_s(args, L"%s /single", args);
|
||||
}
|
||||
swprintf_s(args, L"%s /single", args);
|
||||
}
|
||||
|
||||
if (!streqi(cmderTitle.c_str(), L""))
|
||||
{
|
||||
swprintf_s(args, L"%s /title \"%s\"", args, cmderTitle.c_str());
|
||||
}
|
||||
|
||||
if (cfgRoot.length() != 0)
|
||||
{
|
||||
if (!PathFileExists(windowsTerminalDir)) {
|
||||
swprintf_s(args, L"%s -loadcfgfile \"%s\"", args, userConEmuCfgPath);
|
||||
}
|
||||
swprintf_s(args, L"%s -loadcfgfile \"%s\"", args, userConEmuCfgPath);
|
||||
}
|
||||
|
||||
if (!streqi(cmderTerminalArgs.c_str(), L""))
|
||||
if (!streqi(cmderConEmuArgs.c_str(), L""))
|
||||
{
|
||||
swprintf_s(args, L"%s %s", args, cmderTerminalArgs.c_str());
|
||||
swprintf_s(args, L"%s %s", args, cmderConEmuArgs.c_str());
|
||||
}
|
||||
|
||||
// The `/run` arg and its value MUST be the last arg of ConEmu
|
||||
// see : https://conemu.github.io/en/ConEmuArgs.html
|
||||
// > This must be the last used switch (excepting -new_console and -cur_console)
|
||||
PathCombine(initCmd, vendorDir, L"init.bat");
|
||||
PathCombine(initPowerShell, vendorDir, L"profile.ps1");
|
||||
PathCombine(initBash, vendorDir, L"start_git_bash.cmd");
|
||||
PathCombine(initMintty, vendorDir, L"start_git_mintty.cmd");
|
||||
|
||||
if (!streqi(cmderTask.c_str(), L""))
|
||||
{
|
||||
if (PathFileExists(windowsTerminalDir)) {
|
||||
swprintf_s(args, L"%s -p \"%s\"", args, cmderTask.c_str());
|
||||
}
|
||||
else if (PathFileExists(conEmuDir))
|
||||
{
|
||||
swprintf_s(args, L"%s /run {%s}", args, cmderTask.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (streqi(cmderTask.c_str(), L"powershell"))
|
||||
{
|
||||
swprintf_s(args, L"%s -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command \"Invoke-Expression 'Import-Module ''%s'''\"", args, initPowerShell);
|
||||
}
|
||||
else if (streqi(cmderTask.c_str(), L"bash"))
|
||||
{
|
||||
swprintf_s(args, L"%s /c \"%s\"", args, initBash);
|
||||
}
|
||||
else if (streqi(cmderTask.c_str(), L"mintty"))
|
||||
{
|
||||
swprintf_s(args, L"%s /c \"%s\"", args, initMintty);
|
||||
}
|
||||
else if (streqi(cmderTask.c_str(), L"cmder"))
|
||||
{
|
||||
swprintf_s(args, L"%s /k \"%s\"", args, initCmd);
|
||||
}
|
||||
}
|
||||
swprintf_s(args, L"%s /run {%s}", args, cmderTask.c_str());
|
||||
}
|
||||
|
||||
SetEnvironmentVariable(L"CMDER_ROOT", exeDir);
|
||||
@ -625,54 +455,23 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
||||
SetEnvironmentVariable(L"CMDER_USER_BIN", userBinDirPath);
|
||||
}
|
||||
|
||||
// Try to find m'intty.exe' so ConEmu can launch using %MINTTY_EXE% in external Git for Cmder Mini.
|
||||
// See: https://github.com/Maximus5/ConEmu/issues/2559 for why this is commented.
|
||||
|
||||
/*
|
||||
if (PathFileExists(vendoredGit))
|
||||
{
|
||||
PathCombine(minTTYPath, vendoredGit, L"usr\\bin\\mintty.exe");
|
||||
SetEnvironmentVariable(L"MINTTY_EXE", minTTYPath);
|
||||
}
|
||||
else if (PathFileExists(amdx64Git))
|
||||
{
|
||||
PathCombine(minTTYPath, amdx64Git, L"usr\\bin\\mintty.exe");
|
||||
SetEnvironmentVariable(L"MINTTY_EXE", minTTYPath);
|
||||
}
|
||||
else if (PathFileExists(x86Git))
|
||||
{
|
||||
PathCombine(minTTYPath, x86Git, L"usr\\bin\\mintty.exe");
|
||||
SetEnvironmentVariable(L"MINTTY_EXE", minTTYPath);
|
||||
}
|
||||
*/
|
||||
|
||||
// Ensure EnvironmentVariables are propagated.
|
||||
|
||||
STARTUPINFO si = { 0 };
|
||||
|
||||
si.cb = sizeof(STARTUPINFO);
|
||||
#if USE_TASKBAR_API
|
||||
si.lpTitle = appId;
|
||||
si.dwFlags = STARTF_TITLEISAPPID;
|
||||
#endif
|
||||
#if USE_TASKBAR_API
|
||||
si.lpTitle = appId;
|
||||
si.dwFlags = STARTF_TITLEISAPPID;
|
||||
#endif
|
||||
PROCESS_INFORMATION pi;
|
||||
|
||||
if (!CreateProcess(terminalPath, args, NULL, NULL, false, 0, NULL, NULL, &si, &pi))
|
||||
{
|
||||
if (PathFileExists(windowsTerminalDir))
|
||||
{
|
||||
MessageBox(NULL, _T("Unable to create the Windows Terminal process!"), _T("Error"), MB_OK);
|
||||
}
|
||||
else if (PathFileExists(conEmuDir))
|
||||
{
|
||||
MessageBox(NULL, _T("Unable to create the ConEmu process!"), _T("Error"), MB_OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox(NULL, _T("Unable to create the Cmd process!"), _T("Error"), MB_OK);
|
||||
}
|
||||
if (!CreateProcess(conEmuPath, args, NULL, NULL, false, 0, NULL, NULL, &si, &pi)) {
|
||||
MessageBox(NULL, _T("Unable to create the ConEmu process!"), _T("Error"), MB_OK);
|
||||
return;
|
||||
}
|
||||
|
||||
LRESULT lr = SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)"Environment", SMTO_ABORTIFHUNG | SMTO_NOTIMEOUTIFNOTHUNG, 5000, NULL);
|
||||
lr = SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)L"Environment", SMTO_ABORTIFHUNG | SMTO_NOTIMEOUTIFNOTHUNG, 5000, NULL); // For Windows >= 8
|
||||
}
|
||||
|
||||
bool IsUserOnly(std::wstring opt)
|
||||
@ -725,11 +524,11 @@ void RegisterShellMenu(std::wstring opt, wchar_t* keyBaseName, std::wstring cfgR
|
||||
|
||||
wchar_t commandStr[MAX_PATH + 20] = { 0 };
|
||||
wchar_t baseCommandStr[MAX_PATH + 20] = { 0 };
|
||||
if (single) {
|
||||
swprintf_s(baseCommandStr, L"\"%s\" /single", exePath);
|
||||
if (!single) {
|
||||
swprintf_s(baseCommandStr, L"\"%s\"", exePath);
|
||||
}
|
||||
else {
|
||||
swprintf_s(baseCommandStr, L"\"%s\"", exePath);
|
||||
swprintf_s(baseCommandStr, L"\"%s\" /single", exePath);
|
||||
}
|
||||
|
||||
if (cfgRoot.length() == 0) // '/c [path]' was NOT specified
|
||||
@ -787,7 +586,7 @@ struct cmderOptions
|
||||
std::wstring cmderTitle = L"Cmder";
|
||||
std::wstring cmderIcon = L"";
|
||||
std::wstring cmderRegScope = L"USER";
|
||||
std::wstring cmderTerminalArgs = L"";
|
||||
std::wstring cmderConEmuArgs = L"";
|
||||
bool cmderSingle = false;
|
||||
bool cmderUserCfg = true;
|
||||
bool registerApp = false;
|
||||
@ -801,22 +600,11 @@ cmderOptions GetOption()
|
||||
LPWSTR *szArgList;
|
||||
int argCount;
|
||||
|
||||
wchar_t windowsTerminalDir[MAX_PATH] = { 0 };
|
||||
wchar_t conEmuDir[MAX_PATH] = { 0 };
|
||||
wchar_t vendorDir[MAX_PATH] = { 0 };
|
||||
wchar_t exeDir[MAX_PATH] = { 0 };
|
||||
|
||||
GetModuleFileName(NULL, exeDir, sizeof(exeDir));
|
||||
PathRemoveFileSpec(exeDir);
|
||||
|
||||
PathCombine(vendorDir, exeDir, L"vendor");
|
||||
PathCombine(windowsTerminalDir, vendorDir, L"windows-terminal");
|
||||
PathCombine(conEmuDir, vendorDir, L"ConEmu-Maximus5");
|
||||
|
||||
szArgList = CommandLineToArgvW(GetCommandLine(), &argCount);
|
||||
|
||||
for (int i = 1; i < argCount; i++)
|
||||
{
|
||||
|
||||
// MessageBox(NULL, szArgList[i], L"Arglist contents", MB_OK);
|
||||
if (cmderOptions.error == false) {
|
||||
if (_wcsicmp(L"/c", szArgList[i]) == 0)
|
||||
@ -853,26 +641,26 @@ cmderOptions GetOption()
|
||||
MessageBox(NULL, szArgList[i + 1], L"/START - Folder does not exist!", MB_OK);
|
||||
}
|
||||
}
|
||||
else if (_wcsicmp(L"/task", szArgList[i]) == 0 || PathFileExists(windowsTerminalDir) || PathFileExists(conEmuDir))
|
||||
else if (_wcsicmp(L"/task", szArgList[i]) == 0)
|
||||
{
|
||||
cmderOptions.cmderTask = szArgList[i + 1];
|
||||
i++;
|
||||
}
|
||||
else if (_wcsicmp(L"/title", szArgList[i]) == 0 && !PathFileExists(windowsTerminalDir) && PathFileExists(conEmuDir))
|
||||
else if (_wcsicmp(L"/title", szArgList[i]) == 0)
|
||||
{
|
||||
cmderOptions.cmderTitle = szArgList[i + 1];
|
||||
i++;
|
||||
}
|
||||
else if (_wcsicmp(L"/icon", szArgList[i]) == 0 && !PathFileExists(windowsTerminalDir) && PathFileExists(conEmuDir))
|
||||
else if (_wcsicmp(L"/icon", szArgList[i]) == 0)
|
||||
{
|
||||
cmderOptions.cmderIcon = szArgList[i + 1];
|
||||
i++;
|
||||
}
|
||||
else if (_wcsicmp(L"/single", szArgList[i]) == 0 && !PathFileExists(windowsTerminalDir) && PathFileExists(conEmuDir))
|
||||
else if (_wcsicmp(L"/single", szArgList[i]) == 0)
|
||||
{
|
||||
cmderOptions.cmderSingle = true;
|
||||
}
|
||||
else if (_wcsicmp(L"/m", szArgList[i]) == 0 && !PathFileExists(windowsTerminalDir) && PathFileExists(conEmuDir))
|
||||
else if (_wcsicmp(L"/m", szArgList[i]) == 0)
|
||||
{
|
||||
cmderOptions.cmderUserCfg = false;
|
||||
}
|
||||
@ -905,7 +693,7 @@ cmderOptions GetOption()
|
||||
/* Used for passing arguments to conemu prog */
|
||||
else if (_wcsicmp(L"/x", szArgList[i]) == 0)
|
||||
{
|
||||
cmderOptions.cmderTerminalArgs = szArgList[i + 1];
|
||||
cmderOptions.cmderConEmuArgs = szArgList[i + 1];
|
||||
i++;
|
||||
}
|
||||
/* Bare double dash, remaining commandline is for conemu */
|
||||
@ -915,7 +703,7 @@ cmderOptions GetOption()
|
||||
auto doubledash = cmdline.find(L" -- ");
|
||||
if (doubledash != std::string::npos)
|
||||
{
|
||||
cmderOptions.cmderTerminalArgs = cmdline.substr(doubledash + 4);
|
||||
cmderOptions.cmderConEmuArgs = cmdline.substr(doubledash + 4);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -942,11 +730,7 @@ cmderOptions GetOption()
|
||||
cmderOptions.error = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!PathFileExists(windowsTerminalDir) && !PathFileExists(conEmuDir) && streqi(cmderOptions.cmderTask.c_str(), L""))
|
||||
{
|
||||
cmderOptions.cmderTask = L"cmder";
|
||||
}
|
||||
|
||||
if (cmderOptions.error == true)
|
||||
@ -975,29 +759,12 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
|
||||
|
||||
cmderOptions cmderOptions = GetOption();
|
||||
|
||||
wchar_t windowsTerminalDir[MAX_PATH] = { 0 };
|
||||
wchar_t exeDir[MAX_PATH] = { 0 };
|
||||
|
||||
GetModuleFileName(NULL, exeDir, sizeof(exeDir));
|
||||
PathRemoveFileSpec(exeDir);
|
||||
PathCombine(windowsTerminalDir, exeDir, L"vendor\\windows-terminal");
|
||||
|
||||
if (cmderOptions.registerApp == true)
|
||||
{
|
||||
if (PathFileExists(windowsTerminalDir))
|
||||
{
|
||||
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_PATH_BACKGROUND, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
|
||||
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_PATH_LISTITEM, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
|
||||
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_DRIVE_PATH_BACKGROUND, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
|
||||
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_DRIVE_PATH_LISTITEM, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
|
||||
}
|
||||
else
|
||||
{
|
||||
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_PATH_BACKGROUND, cmderOptions.cmderCfgRoot, false);
|
||||
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_PATH_LISTITEM, cmderOptions.cmderCfgRoot, false);
|
||||
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_DRIVE_PATH_BACKGROUND, cmderOptions.cmderCfgRoot, false);
|
||||
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_DRIVE_PATH_LISTITEM, cmderOptions.cmderCfgRoot, false);
|
||||
}
|
||||
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_PATH_BACKGROUND, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
|
||||
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_PATH_LISTITEM, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
|
||||
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_DRIVE_PATH_BACKGROUND, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
|
||||
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_DRIVE_PATH_LISTITEM, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
|
||||
}
|
||||
else if (cmderOptions.unRegisterApp == true)
|
||||
{
|
||||
@ -1012,7 +779,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
|
||||
}
|
||||
else
|
||||
{
|
||||
StartCmder(cmderOptions.cmderStart, cmderOptions.cmderSingle, cmderOptions.cmderTask, cmderOptions.cmderTitle, cmderOptions.cmderIcon, cmderOptions.cmderCfgRoot, cmderOptions.cmderUserCfg, cmderOptions.cmderTerminalArgs);
|
||||
StartCmder(cmderOptions.cmderStart, cmderOptions.cmderSingle, cmderOptions.cmderTask, cmderOptions.cmderTitle, cmderOptions.cmderIcon, cmderOptions.cmderCfgRoot, cmderOptions.cmderUserCfg, cmderOptions.cmderConEmuArgs);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -35,19 +35,19 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#include ""winres.h""\r\n"
|
||||
"\0"
|
||||
"#include ""winres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
@ -60,7 +60,7 @@ END
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDI_CMDER ICON "..\\..\\icons\\cmder.ico"
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
#endif // English (United States) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -6,7 +6,7 @@ STRINGTABLE
|
||||
{
|
||||
IDS_TITLE "Cmder Launcher"
|
||||
|
||||
IDS_SWITCHES L"Valid options:\n\n /c [CMDER User Root Path]\n /task [Windows Terminal Profile/ConEmu Task Name]\n /icon [CMDER Icon Path] - ConEmu ONLY!\n [/start [Start in Path] | [Start in Path]]\n /single - ConEmu ONLY!\n /m\n -- [ConEmu/Windows Terminal extra arguments]\n\nNote: '-- [...]' must be the last argument!\n\nor, either:\n /register [USER | ALL]\n /unregister [USER | ALL]"
|
||||
IDS_SWITCHES L"Valid options:\n\n /c [CMDER User Root Path]\n /task [ConEmu Task Name]\n /icon [CMDER Icon Path]\n [/start [Start in Path] | [Start in Path]]\n /single\n /m\n /x [ConEmu extra arguments]\n\nor, either:\n /register [USER | ALL]\n /unregister [USER | ALL]"
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -1,8 +1,9 @@
|
||||
|
||||
/**
|
||||
* WARNING: This file should NOT be manually modified!
|
||||
* The contents will be automatically generated using the `.ps1` PowerShell scripts,
|
||||
* during builds by the CI.
|
||||
* WARNING: do NOT modify this file! the content of this file should be
|
||||
* automatically genereted before AppVeyor builds using the
|
||||
* respective .ps1 Powershell scripts.
|
||||
*
|
||||
*/
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -23,6 +23,7 @@ appveyor.yml
|
||||
vendor\cmder.sh
|
||||
vendor\git-prompt.sh
|
||||
config\user-*
|
||||
config\user_*
|
||||
clink_history*
|
||||
*.log
|
||||
Vagrantfile
|
||||
*.box
|
||||
|
@ -56,9 +56,6 @@ Param(
|
||||
# Using this option will skip all downloads, if you only need to build launcher
|
||||
[switch]$noVendor,
|
||||
|
||||
# Using this option will specify the emulator to use [none, all, conemu-maximus5, or windows-terminal]
|
||||
[string]$terminal = 'all',
|
||||
|
||||
# Build launcher if you have MSBuild tools installed
|
||||
[switch]$Compile
|
||||
)
|
||||
@ -82,7 +79,7 @@ if ($Compile) {
|
||||
|
||||
Write-Verbose "Building the launcher..."
|
||||
|
||||
# Reference: https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
|
||||
# Referene: https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
|
||||
msbuild CmderLauncher.vcxproj /t:Clean,Build /p:configuration=Release /m
|
||||
|
||||
if ($LastExitCode -ne 0) {
|
||||
@ -116,36 +113,15 @@ if (-not $noVendor) {
|
||||
}
|
||||
else { $ConEmuXml = "" }
|
||||
|
||||
# Preserve modified (by user) Windows Terminal setting file
|
||||
if ($config -ne "") {
|
||||
$WinTermSettingsJson = Join-Path $saveTo "windows-terminal\settings\settings.json"
|
||||
if (Test-Path $WinTermSettingsJson -pathType leaf) {
|
||||
$WinTermSettingsJsonSave = Join-Path $config "windows_terminal_settings.json"
|
||||
Write-Verbose "Backup '$WinTermSettingsJson' to '$WinTermSettingsJsonSave'"
|
||||
Copy-Item $WinTermSettingsJson $WinTermSettingsJsonSave
|
||||
}
|
||||
else { $WinTermSettingsJson = "" }
|
||||
}
|
||||
else { $WinTermSettingsJson = "" }
|
||||
|
||||
# Kill ssh-agent.exe if it is running from the $env:cmder_root we are building
|
||||
$cmder_folder = $cmder_root.toString()
|
||||
foreach ($ssh_agent in $(Get-Process ssh-agent -ErrorAction SilentlyContinue)) {
|
||||
if ([string]$($ssh_agent.path) -Match $cmder_folder.Replace('\', '\\')) {
|
||||
if ([string]$($ssh_agent.path) -Match [string]$cmder_root.replace('\', '\\')) {
|
||||
Write-Verbose $("Stopping " + $ssh_agent.path + "!")
|
||||
Stop-Process $ssh_agent.id
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($s in $sources) {
|
||||
if ($terminal -eq "none") {
|
||||
return
|
||||
} elseif ($s.name -eq "conemu-maximus5" -and $terminal -eq "windows-terminal") {
|
||||
return
|
||||
} elseif ($s.name -eq "windows-terminal" -and $terminal -eq "conemu-maximus5") {
|
||||
return
|
||||
}
|
||||
|
||||
Write-Verbose "Getting vendored $($s.name) $($s.version)..."
|
||||
|
||||
# We do not care about the extensions/type of archive
|
||||
@ -156,16 +132,6 @@ if (-not $noVendor) {
|
||||
Download-File -Url $s.url -File $vend\$tempArchive -ErrorAction Stop
|
||||
Extract-Archive $tempArchive $s.name
|
||||
|
||||
# Make Embedded Windows Terminal Portable
|
||||
if ($s.name -eq "windows-terminal") {
|
||||
$windowTerminalFiles = resolve-path ($saveTo + "\" + $s.name + "\terminal*")
|
||||
move-item -ErrorAction SilentlyContinue $windowTerminalFiles\* $s.name >$null
|
||||
remove-item -ErrorAction SilentlyContinue $windowTerminalFiles >$null
|
||||
write-verbose "Making Windows Terminal Portable..."
|
||||
New-Item -Type Directory -Path (Join-Path $saveTo "/windows-terminal/settings") -ErrorAction SilentlyContinue >$null
|
||||
New-Item -Type File -Path (Join-Path $saveTo "/windows-terminal/.portable") -ErrorAction SilentlyContinue >$null
|
||||
}
|
||||
|
||||
if ((Get-ChildItem $s.name).Count -eq 1) {
|
||||
Flatten-Directory($s.name)
|
||||
}
|
||||
@ -180,12 +146,6 @@ if (-not $noVendor) {
|
||||
Copy-Item $ConEmuXmlSave $ConEmuXml
|
||||
}
|
||||
|
||||
# Restore Windows Terminal user configuration
|
||||
if ($WinTermSettingsJson -ne "") {
|
||||
Write-Verbose "Restore '$WinTermSettingsJsonSave' to '$WinTermSettingsJson'"
|
||||
Copy-Item $WinTermSettingsJsonSave $WinTermSettingsJson
|
||||
}
|
||||
|
||||
# Put vendor\cmder.sh in /etc/profile.d so it runs when we start bash or mintty
|
||||
if ( (Test-Path $($saveTo + "git-for-windows/etc/profile.d") ) ) {
|
||||
Write-Verbose "Adding cmder.sh /etc/profile.d"
|
||||
|
@ -31,9 +31,6 @@ Param(
|
||||
# Path to the vendor configuration source file
|
||||
[string]$cmderRoot = "$PSScriptRoot\..",
|
||||
|
||||
# Using this option will pack artifacts for a specific included terminal emulator [none, all, conemu-maximus5, or windows-terminal]
|
||||
[string]$terminal = 'all',
|
||||
|
||||
# Vendor folder locaton
|
||||
[string]$saveTo = "$PSScriptRoot\..\build"
|
||||
)
|
||||
@ -44,36 +41,10 @@ $cmderRoot = Resolve-Path $cmderRoot
|
||||
$ErrorActionPreference = "Stop"
|
||||
Ensure-Executable "7z"
|
||||
|
||||
if ($terminal -eq "none") {
|
||||
$targets = @{
|
||||
"cmder_win.7z" = "-t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -myx=7 -mqs=on -xr!`"vendor\conemu-maximus5`" -xr!`"vendor\windows-terminal`"";
|
||||
"cmder_win.zip" = "-mm=Deflate -mfb=128 -mpass=3 -xr!`"vendor\conemu-maximus5`" -xr!`"vendor\windows-terminal`"";
|
||||
"cmder_win.mini.zip" = "-xr!`"vendor\git-for-windows`" -xr!`"vendor\conemu-maximus5`" -xr!`"vendor\windows-terminal`"";
|
||||
}
|
||||
} elseif ($terminal -eq "windows-terminal") {
|
||||
$targets = @{
|
||||
"cmder_wt.7z" = "-t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -myx=7 -mqs=on -xr!`"vendor\conemu-maximus5`"";
|
||||
"cmder_wt.zip" = "-mm=Deflate -mfb=128 -mpass=3 -xr!`"vendor\conemu-maximus5`"";
|
||||
"cmder_wt_mini.zip" = "-xr!`"vendor\git-for-windows`" -xr!`"vendor\conemu-maximus5`"";
|
||||
}
|
||||
} elseif ($terminal -eq "windows-terminal") {
|
||||
$targets = @{
|
||||
"cmder.7z" = "-t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -myx=7 -mqs=on -xr!`"vendor\windows-terminal`"";
|
||||
"cmder.zip" = "-mm=Deflate -mfb=128 -mpass=3 -xr!`"vendor\windows-terminal`"";
|
||||
"cmder_mini.zip" = "-xr!`"vendor\git-for-windows`" -xr!`"vendor\windows-terminal`"";
|
||||
}
|
||||
} else {
|
||||
$targets = @{
|
||||
"cmder_win.7z" = "-t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -myx=7 -mqs=on -xr!`"vendor\conemu-maximus5`" -xr!`"vendor\windows-terminal`"";
|
||||
"cmder_win.zip" = "-mm=Deflate -mfb=128 -mpass=3 -xr!`"vendor\conemu-maximus5`" -xr!`"vendor\windows-terminal`"";
|
||||
"cmder_win_mini.zip" = "-xr!`"vendor\git-for-windows`" -xr!`"vendor\conemu-maximus5`" -xr!`"vendor\windows-terminal`"";
|
||||
"cmder_wt.7z" = "-t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -myx=7 -mqs=on -xr!`"vendor\conemu-maximus5`"";
|
||||
"cmder_wt.zip" = "-mm=Deflate -mfb=128 -mpass=3 -xr!`"vendor\conemu-maximus5`"";
|
||||
"cmder_wt_mini.zip" = "-xr!`"vendor\git-for-windows`" -xr!`"vendor\conemu-maximus5`"";
|
||||
"cmder.7z" = "-t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -myx=7 -mqs=on -xr!`"vendor\windows-terminal`"";
|
||||
"cmder.zip" = "-mm=Deflate -mfb=128 -mpass=3 -xr!`"vendor\windows-terminal`"";
|
||||
"cmder_mini.zip" = "-xr!`"vendor\git-for-windows`" -xr!`"vendor\windows-terminal`"";
|
||||
}
|
||||
$targets = @{
|
||||
"cmder.7z" = "-t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -myx=7 -mqs=on";
|
||||
"cmder.zip" = "-mm=Deflate -mfb=128 -mpass=3";
|
||||
"cmder_mini.zip" = "-xr!`"vendor\git-for-windows`"";
|
||||
}
|
||||
|
||||
Push-Location -Path $cmderRoot
|
||||
|
8
scripts/packer/README.md
Normal file
8
scripts/packer/README.md
Normal file
@ -0,0 +1,8 @@
|
||||
# Packer Support - Release Notes
|
||||
|
||||
Most of the Packer support for Cmder is shamelessly being borrowed from the following repositories.
|
||||
|
||||
- [StefanScherer/packer-windows](https://github.com/StefanScherer/packer-windows)
|
||||
- [Baune8D/packer-windows-desktop](https://github.com/Baune8D/packer-windows-desktop)
|
||||
|
||||
Thank you both for the good work!
|
228
scripts/packer/answer_files/10_efi/Autounattend.xml
Normal file
228
scripts/packer/answer_files/10_efi/Autounattend.xml
Normal file
@ -0,0 +1,228 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<unattend xmlns="urn:schemas-microsoft-com:unattend">
|
||||
<servicing/>
|
||||
<settings pass="windowsPE">
|
||||
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
|
||||
<DiskConfiguration>
|
||||
<Disk wcm:action="add">
|
||||
<CreatePartitions>
|
||||
<CreatePartition wcm:action="add">
|
||||
<Order>1</Order>
|
||||
<Size>500</Size>
|
||||
<Type>EFI</Type>
|
||||
</CreatePartition>
|
||||
<CreatePartition wcm:action="add">
|
||||
<Order>2</Order>
|
||||
<Size>128</Size>
|
||||
<Type>MSR</Type>
|
||||
</CreatePartition>
|
||||
<CreatePartition wcm:action="add">
|
||||
<Order>3</Order>
|
||||
<Extend>true</Extend>
|
||||
<Type>Primary</Type>
|
||||
</CreatePartition>
|
||||
</CreatePartitions>
|
||||
<DiskID>0</DiskID>
|
||||
<WillWipeDisk>true</WillWipeDisk>
|
||||
</Disk>
|
||||
</DiskConfiguration>
|
||||
<UserData>
|
||||
<AcceptEula>true</AcceptEula>
|
||||
<FullName>Vagrant</FullName>
|
||||
<Organization>Vagrant</Organization>
|
||||
<ProductKey>
|
||||
<Key>W269N-WFGWX-YVC9B-4J6C9-T83GX</Key>
|
||||
<WillShowUI>Never</WillShowUI>
|
||||
</ProductKey>
|
||||
</UserData>
|
||||
<ImageInstall>
|
||||
<OSImage>
|
||||
<InstallTo>
|
||||
<DiskID>0</DiskID>
|
||||
<PartitionID>3</PartitionID>
|
||||
</InstallTo>
|
||||
<WillShowUI>OnError</WillShowUI>
|
||||
<InstallToAvailablePartition>false</InstallToAvailablePartition>
|
||||
</OSImage>
|
||||
</ImageInstall>
|
||||
</component>
|
||||
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
|
||||
<SetupUILanguage>
|
||||
<UILanguage>en-US</UILanguage>
|
||||
</SetupUILanguage>
|
||||
<InputLocale>en-US</InputLocale>
|
||||
<SystemLocale>en-US</SystemLocale>
|
||||
<UILanguage>en-US</UILanguage>
|
||||
<UILanguageFallback>en-US</UILanguageFallback>
|
||||
<UserLocale>en-US</UserLocale>
|
||||
</component>
|
||||
</settings>
|
||||
<settings pass="offlineServicing">
|
||||
<component name="Microsoft-Windows-LUA-Settings" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
|
||||
<EnableLUA>false</EnableLUA>
|
||||
</component>
|
||||
</settings>
|
||||
<settings pass="oobeSystem">
|
||||
<component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<InputLocale>en-US</InputLocale>
|
||||
<SystemLocale>en-US</SystemLocale>
|
||||
<UILanguage>en-US</UILanguage>
|
||||
<UserLocale>en-US</UserLocale>
|
||||
</component>
|
||||
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
|
||||
<UserAccounts>
|
||||
<AdministratorPassword>
|
||||
<Value>vagrant</Value>
|
||||
<PlainText>true</PlainText>
|
||||
</AdministratorPassword>
|
||||
<LocalAccounts>
|
||||
<LocalAccount wcm:action="add">
|
||||
<Password>
|
||||
<Value>vagrant</Value>
|
||||
<PlainText>true</PlainText>
|
||||
</Password>
|
||||
<Description>Vagrant User</Description>
|
||||
<DisplayName>vagrant</DisplayName>
|
||||
<Group>administrators</Group>
|
||||
<Name>vagrant</Name>
|
||||
</LocalAccount>
|
||||
</LocalAccounts>
|
||||
</UserAccounts>
|
||||
<OOBE>
|
||||
<HideEULAPage>true</HideEULAPage>
|
||||
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
|
||||
<NetworkLocation>Home</NetworkLocation>
|
||||
<ProtectYourPC>1</ProtectYourPC>
|
||||
</OOBE>
|
||||
<AutoLogon>
|
||||
<Password>
|
||||
<Value>vagrant</Value>
|
||||
<PlainText>true</PlainText>
|
||||
</Password>
|
||||
<Username>vagrant</Username>
|
||||
<Enabled>true</Enabled>
|
||||
</AutoLogon>
|
||||
<FirstLogonCommands>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine>
|
||||
<Description>Set Execution Policy 64 Bit</Description>
|
||||
<Order>1</Order>
|
||||
<RequiresUserInput>true</RequiresUserInput>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine>
|
||||
<Description>Set Execution Policy 32 Bit</Description>
|
||||
<Order>2</Order>
|
||||
<RequiresUserInput>true</RequiresUserInput>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>cmd.exe /c reg add "HKLM\System\CurrentControlSet\Control\Network\NewNetworkWindowOff"</CommandLine>
|
||||
<Description>Network prompt</Description>
|
||||
<Order>3</Order>
|
||||
<RequiresUserInput>true</RequiresUserInput>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File e:\fixnetwork.ps1</CommandLine>
|
||||
<Description>Fix public network</Description>
|
||||
<Order>4</Order>
|
||||
<RequiresUserInput>true</RequiresUserInput>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File e:\disable-winrm.ps1</CommandLine>
|
||||
<Description>Disable WinRM</Description>
|
||||
<Order>5</Order>
|
||||
<RequiresUserInput>true</RequiresUserInput>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>%SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v HideFileExt /t REG_DWORD /d 0 /f</CommandLine>
|
||||
<Order>6</Order>
|
||||
<Description>Show file extensions in Explorer</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>%SystemRoot%\System32\reg.exe ADD HKCU\Console /v QuickEdit /t REG_DWORD /d 1 /f</CommandLine>
|
||||
<Order>7</Order>
|
||||
<Description>Enable QuickEdit mode</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>%SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v Start_ShowRun /t REG_DWORD /d 1 /f</CommandLine>
|
||||
<Order>8</Order>
|
||||
<Description>Show Run command in Start Menu</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>%SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v StartMenuAdminTools /t REG_DWORD /d 1 /f</CommandLine>
|
||||
<Order>9</Order>
|
||||
<Description>Show Administrative Tools in Start Menu</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>%SystemRoot%\System32\reg.exe ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateFileSizePercent /t REG_DWORD /d 0 /f</CommandLine>
|
||||
<Order>10</Order>
|
||||
<Description>Zero Hibernation File</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>%SystemRoot%\System32\reg.exe ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateEnabled /t REG_DWORD /d 0 /f</CommandLine>
|
||||
<Order>11</Order>
|
||||
<Description>Disable Hibernation Mode</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>cmd.exe /c wmic useraccount where "name='vagrant'" set PasswordExpires=FALSE</CommandLine>
|
||||
<Order>12</Order>
|
||||
<Description>Disable password expiration for vagrant user</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>%SystemRoot%\System32\reg.exe ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultPassword /t REG_SZ /d "vagrant" /f</CommandLine>
|
||||
<Order>13</Order>
|
||||
<Description>Enable AutoLogon</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>%SystemRoot%\System32\reg.exe ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoAdminLogon /t REG_SZ /d 1 /f</CommandLine>
|
||||
<Order>14</Order>
|
||||
<Description>Enable AutoLogon</Description>
|
||||
</SynchronousCommand>
|
||||
<!-- WITHOUT WINDOWS UPDATES -->
|
||||
<!--
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File e:\enable-winrm.ps1</CommandLine>
|
||||
<Description>Enable WinRM</Description>
|
||||
<Order>99</Order>
|
||||
</SynchronousCommand>
|
||||
-->
|
||||
<!-- END WITHOUT WINDOWS UPDATES -->
|
||||
<!-- WITH WINDOWS UPDATES -->
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>cmd.exe /c e:\microsoft-updates.bat</CommandLine>
|
||||
<Order>98</Order>
|
||||
<Description>Enable Microsoft Updates</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File e:\disable-screensaver.ps1</CommandLine>
|
||||
<Description>Disable Screensaver</Description>
|
||||
<Order>99</Order>
|
||||
<RequiresUserInput>true</RequiresUserInput>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File e:\win-updates.ps1</CommandLine>
|
||||
<Description>Install Windows Updates</Description>
|
||||
<Order>100</Order>
|
||||
<RequiresUserInput>true</RequiresUserInput>
|
||||
</SynchronousCommand>
|
||||
<!-- END WITH WINDOWS UPDATES -->
|
||||
</FirstLogonCommands>
|
||||
<ShowWindowsLive>false</ShowWindowsLive>
|
||||
</component>
|
||||
</settings>
|
||||
<settings pass="specialize">
|
||||
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
|
||||
<OEMInformation>
|
||||
<HelpCustomized>false</HelpCustomized>
|
||||
</OEMInformation>
|
||||
<!-- Rename computer here. -->
|
||||
<ComputerName>vagrant-win10</ComputerName>
|
||||
<TimeZone>Pacific Standard Time</TimeZone>
|
||||
<RegisteredOwner/>
|
||||
</component>
|
||||
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
|
||||
<SkipAutoActivation>true</SkipAutoActivation>
|
||||
</component>
|
||||
</settings>
|
||||
<cpi:offlineImage xmlns:cpi="urn:schemas-microsoft-com:cpi" cpi:source="catalog:d:/sources/install_windows 7 ENTERPRISE.clg"/>
|
||||
</unattend>
|
298
scripts/packer/answer_files/11/Autounattend.xml
Normal file
298
scripts/packer/answer_files/11/Autounattend.xml
Normal file
@ -0,0 +1,298 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<unattend xmlns="urn:schemas-microsoft-com:unattend">
|
||||
<servicing/>
|
||||
<settings pass="windowsPE">
|
||||
<component name="Microsoft-Windows-PnpCustomizationsWinPE"
|
||||
publicKeyToken="31bf3856ad364e35" language="neutral"
|
||||
versionScope="nonSxS" processorArchitecture="amd64"
|
||||
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
|
||||
|
||||
<!--
|
||||
This makes the VirtIO drivers available to Windows, assuming that
|
||||
the VirtIO driver disk at https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso
|
||||
(see https://docs.fedoraproject.org/en-US/quick-docs/creating-windows-virtual-machines-using-virtio-drivers/index.html#virtio-win-direct-downloads)
|
||||
is available as drive E:
|
||||
-->
|
||||
<DriverPaths>
|
||||
<PathAndCredentials wcm:action="add" wcm:keyValue="2">
|
||||
<Path>E:\viostor\w10\amd64</Path>
|
||||
</PathAndCredentials>
|
||||
|
||||
<PathAndCredentials wcm:action="add" wcm:keyValue="3">
|
||||
<Path>E:\NetKVM\w10\amd64</Path>
|
||||
</PathAndCredentials>
|
||||
|
||||
<PathAndCredentials wcm:action="add" wcm:keyValue="4">
|
||||
<Path>E:\Balloon\w10\amd64</Path>
|
||||
</PathAndCredentials>
|
||||
|
||||
<PathAndCredentials wcm:action="add" wcm:keyValue="5">
|
||||
<Path>E:\pvpanic\w10\amd64</Path>
|
||||
</PathAndCredentials>
|
||||
|
||||
<PathAndCredentials wcm:action="add" wcm:keyValue="6">
|
||||
<Path>E:\qemupciserial\w10\amd64</Path>
|
||||
</PathAndCredentials>
|
||||
|
||||
<PathAndCredentials wcm:action="add" wcm:keyValue="7">
|
||||
<Path>E:\qxldod\w10\amd64</Path>
|
||||
</PathAndCredentials>
|
||||
|
||||
<PathAndCredentials wcm:action="add" wcm:keyValue="8">
|
||||
<Path>E:\vioinput\w10\amd64</Path>
|
||||
</PathAndCredentials>
|
||||
|
||||
<PathAndCredentials wcm:action="add" wcm:keyValue="9">
|
||||
<Path>E:\viorng\w10\amd64</Path>
|
||||
</PathAndCredentials>
|
||||
|
||||
<PathAndCredentials wcm:action="add" wcm:keyValue="10">
|
||||
<Path>E:\vioscsi\w10\amd64</Path>
|
||||
</PathAndCredentials>
|
||||
|
||||
<PathAndCredentials wcm:action="add" wcm:keyValue="11">
|
||||
<Path>E:\vioserial\w10\amd64</Path>
|
||||
</PathAndCredentials>
|
||||
</DriverPaths>
|
||||
</component>
|
||||
|
||||
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
|
||||
<DiskConfiguration>
|
||||
<Disk wcm:action="add">
|
||||
<CreatePartitions>
|
||||
<CreatePartition wcm:action="add">
|
||||
<Order>1</Order>
|
||||
<Type>Primary</Type>
|
||||
<Extend>true</Extend>
|
||||
</CreatePartition>
|
||||
</CreatePartitions>
|
||||
<ModifyPartitions>
|
||||
<ModifyPartition wcm:action="add">
|
||||
<Extend>false</Extend>
|
||||
<Format>NTFS</Format>
|
||||
<Letter>C</Letter>
|
||||
<Order>1</Order>
|
||||
<PartitionID>1</PartitionID>
|
||||
<Label>Windows 11</Label>
|
||||
</ModifyPartition>
|
||||
</ModifyPartitions>
|
||||
<DiskID>0</DiskID>
|
||||
<WillWipeDisk>true</WillWipeDisk>
|
||||
</Disk>
|
||||
<WillShowUI>OnError</WillShowUI>
|
||||
</DiskConfiguration>
|
||||
<UserData>
|
||||
<AcceptEula>true</AcceptEula>
|
||||
<FullName>Vagrant</FullName>
|
||||
<Organization>Vagrant</Organization>
|
||||
|
||||
<!--
|
||||
NOTE: If you are re-configuring this for use of a retail key
|
||||
and using a retail ISO, you need to adjust the <ProductKey> block
|
||||
below to look like this:
|
||||
|
||||
<ProductKey>
|
||||
<Key>W269N-WFGWX-YVC9B-4J6C9-T83GX</Key>
|
||||
<WillShowUI>Never</WillShowUI>
|
||||
</ProductKey>
|
||||
|
||||
Notice the addition of the `<Key>` element.
|
||||
-->
|
||||
</UserData>
|
||||
<ImageInstall>
|
||||
<OSImage>
|
||||
<InstallTo>
|
||||
<DiskID>0</DiskID>
|
||||
<PartitionID>1</PartitionID>
|
||||
</InstallTo>
|
||||
<WillShowUI>OnError</WillShowUI>
|
||||
<InstallToAvailablePartition>false</InstallToAvailablePartition>
|
||||
<InstallFrom>
|
||||
<MetaData wcm:action="add">
|
||||
<Key>/IMAGE/NAME</Key>
|
||||
<Value>Windows 11 Enterprise Evaluation</Value>
|
||||
</MetaData>
|
||||
</InstallFrom>
|
||||
</OSImage>
|
||||
</ImageInstall>
|
||||
</component>
|
||||
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
|
||||
<SetupUILanguage>
|
||||
<UILanguage>en-US</UILanguage>
|
||||
</SetupUILanguage>
|
||||
<InputLocale>en-US</InputLocale>
|
||||
<SystemLocale>en-US</SystemLocale>
|
||||
<UILanguage>en-US</UILanguage>
|
||||
<UILanguageFallback>en-US</UILanguageFallback>
|
||||
<UserLocale>en-US</UserLocale>
|
||||
</component>
|
||||
</settings>
|
||||
<settings pass="offlineServicing">
|
||||
<component name="Microsoft-Windows-LUA-Settings" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
|
||||
<EnableLUA>false</EnableLUA>
|
||||
</component>
|
||||
</settings>
|
||||
<settings pass="oobeSystem">
|
||||
<component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<InputLocale>en-US</InputLocale>
|
||||
<SystemLocale>en-US</SystemLocale>
|
||||
<UILanguage>en-US</UILanguage>
|
||||
<UserLocale>en-US</UserLocale>
|
||||
</component>
|
||||
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
|
||||
<UserAccounts>
|
||||
<AdministratorPassword>
|
||||
<Value>vagrant</Value>
|
||||
<PlainText>true</PlainText>
|
||||
</AdministratorPassword>
|
||||
<LocalAccounts>
|
||||
<LocalAccount wcm:action="add">
|
||||
<Password>
|
||||
<Value>vagrant</Value>
|
||||
<PlainText>true</PlainText>
|
||||
</Password>
|
||||
<Description>Vagrant User</Description>
|
||||
<DisplayName>vagrant</DisplayName>
|
||||
<Group>administrators</Group>
|
||||
<Name>vagrant</Name>
|
||||
</LocalAccount>
|
||||
</LocalAccounts>
|
||||
</UserAccounts>
|
||||
<OOBE>
|
||||
<HideEULAPage>true</HideEULAPage>
|
||||
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
|
||||
<NetworkLocation>Home</NetworkLocation>
|
||||
<ProtectYourPC>1</ProtectYourPC>
|
||||
</OOBE>
|
||||
<AutoLogon>
|
||||
<Password>
|
||||
<Value>vagrant</Value>
|
||||
<PlainText>true</PlainText>
|
||||
</Password>
|
||||
<Username>vagrant</Username>
|
||||
<Enabled>true</Enabled>
|
||||
</AutoLogon>
|
||||
<FirstLogonCommands>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine>
|
||||
<Description>Set Execution Policy 64 Bit</Description>
|
||||
<Order>1</Order>
|
||||
<RequiresUserInput>true</RequiresUserInput>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine>
|
||||
<Description>Set Execution Policy 32 Bit</Description>
|
||||
<Order>2</Order>
|
||||
<RequiresUserInput>true</RequiresUserInput>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>cmd.exe /c reg add "HKLM\System\CurrentControlSet\Control\Network\NewNetworkWindowOff"</CommandLine>
|
||||
<Description>Network prompt</Description>
|
||||
<Order>3</Order>
|
||||
<RequiresUserInput>true</RequiresUserInput>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\fixnetwork.ps1</CommandLine>
|
||||
<Description>Fix public network</Description>
|
||||
<Order>4</Order>
|
||||
<RequiresUserInput>true</RequiresUserInput>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\disable-winrm.ps1</CommandLine>
|
||||
<Description>Disable WinRM</Description>
|
||||
<Order>5</Order>
|
||||
<RequiresUserInput>true</RequiresUserInput>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>%SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v HideFileExt /t REG_DWORD /d 0 /f</CommandLine>
|
||||
<Order>6</Order>
|
||||
<Description>Show file extensions in Explorer</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>%SystemRoot%\System32\reg.exe ADD HKCU\Console /v QuickEdit /t REG_DWORD /d 1 /f</CommandLine>
|
||||
<Order>7</Order>
|
||||
<Description>Enable QuickEdit mode</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>%SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v Start_ShowRun /t REG_DWORD /d 1 /f</CommandLine>
|
||||
<Order>8</Order>
|
||||
<Description>Show Run command in Start Menu</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>%SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v StartMenuAdminTools /t REG_DWORD /d 1 /f</CommandLine>
|
||||
<Order>9</Order>
|
||||
<Description>Show Administrative Tools in Start Menu</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>%SystemRoot%\System32\reg.exe ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateFileSizePercent /t REG_DWORD /d 0 /f</CommandLine>
|
||||
<Order>10</Order>
|
||||
<Description>Zero Hibernation File</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>%SystemRoot%\System32\reg.exe ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateEnabled /t REG_DWORD /d 0 /f</CommandLine>
|
||||
<Order>11</Order>
|
||||
<Description>Disable Hibernation Mode</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>cmd.exe /c wmic useraccount where "name='vagrant'" set PasswordExpires=FALSE</CommandLine>
|
||||
<Order>12</Order>
|
||||
<Description>Disable password expiration for vagrant user</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>%SystemRoot%\System32\reg.exe ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultPassword /t REG_SZ /d "vagrant" /f</CommandLine>
|
||||
<Order>13</Order>
|
||||
<Description>Enable AutoLogon</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>%SystemRoot%\System32\reg.exe ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoAdminLogon /t REG_SZ /d 1 /f</CommandLine>
|
||||
<Order>14</Order>
|
||||
<Description>Enable AutoLogon</Description>
|
||||
</SynchronousCommand>
|
||||
<!-- WITHOUT WINDOWS UPDATES -->
|
||||
<!--
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\enable-winrm.ps1</CommandLine>
|
||||
<Description>Enable WinRM</Description>
|
||||
<Order>99</Order>
|
||||
</SynchronousCommand>
|
||||
-->
|
||||
<!-- END WITHOUT WINDOWS UPDATES -->
|
||||
<!-- WITH WINDOWS UPDATES -->
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>cmd.exe /c a:\microsoft-updates.bat</CommandLine>
|
||||
<Order>98</Order>
|
||||
<Description>Enable Microsoft Updates</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\disable-screensaver.ps1</CommandLine>
|
||||
<Description>Disable Screensaver</Description>
|
||||
<Order>99</Order>
|
||||
<RequiresUserInput>true</RequiresUserInput>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<CommandLine>cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File a:\win-updates.ps1</CommandLine>
|
||||
<Description>Install Windows Updates</Description>
|
||||
<Order>100</Order>
|
||||
<RequiresUserInput>true</RequiresUserInput>
|
||||
</SynchronousCommand>
|
||||
<!-- END WITH WINDOWS UPDATES -->
|
||||
</FirstLogonCommands>
|
||||
<ShowWindowsLive>false</ShowWindowsLive>
|
||||
</component>
|
||||
</settings>
|
||||
<settings pass="specialize">
|
||||
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
|
||||
<OEMInformation>
|
||||
<HelpCustomized>false</HelpCustomized>
|
||||
</OEMInformation>
|
||||
<!-- Rename computer here. -->
|
||||
<ComputerName>vagrant-11</ComputerName>
|
||||
<TimeZone>Pacific Standard Time</TimeZone>
|
||||
<RegisteredOwner/>
|
||||
</component>
|
||||
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
|
||||
<SkipAutoActivation>true</SkipAutoActivation>
|
||||
</component>
|
||||
</settings>
|
||||
<cpi:offlineImage xmlns:cpi="urn:schemas-microsoft-com:cpi" cpi:source="catalog:d:/sources/install_windows 7 ENTERPRISE.clg"/>
|
||||
</unattend>
|
3
scripts/packer/build_windows_10.bat
Normal file
3
scripts/packer/build_windows_10.bat
Normal file
@ -0,0 +1,3 @@
|
||||
@echo off
|
||||
|
||||
packer build --force --only=%~1-iso windows_10.json
|
3
scripts/packer/build_windows_10.sh
Executable file
3
scripts/packer/build_windows_10.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
packer build --force --only=$1-iso windows_10.json
|
4
scripts/packer/build_windows_11.bat
Normal file
4
scripts/packer/build_windows_11.bat
Normal file
@ -0,0 +1,4 @@
|
||||
@echo off
|
||||
|
||||
packer build --only=%1-iso windows_11.json
|
||||
|
4
scripts/packer/build_windows_11.sh
Executable file
4
scripts/packer/build_windows_11.sh
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
packer build --only=$1-iso windows_11.json
|
||||
|
BIN
scripts/packer/floppy/PinTo10.exe
Normal file
BIN
scripts/packer/floppy/PinTo10.exe
Normal file
Binary file not shown.
38
scripts/packer/floppy/ReadMe.txt
Normal file
38
scripts/packer/floppy/ReadMe.txt
Normal file
@ -0,0 +1,38 @@
|
||||
: Release v1.2 - Stuart Pearson 16th Nov 2015
|
||||
:
|
||||
: Command line tool to pin and unpin exe / lnk files to the Windows 10 taskbar and start menu.
|
||||
:
|
||||
: PinTo10 is a command line tool to pin and unpin .exe or .lnk files to or from the Windows 10 taskbar and start menu.
|
||||
: With it you can pin or unpin up to 10 different shortcuts to either the taskbar or start menu in one run of the command.
|
||||
: It replaces functionality that Microsoft have removed from their Windows 10 scripting interface.
|
||||
:
|
||||
: The exe needs to be run with at least one pair of switches specified for each function to Pin / Unpin to Taskbar / Start Menu...
|
||||
:
|
||||
: To pin an application or shortcut to the taskbar (replace XX with 01-10)...
|
||||
: /PTFOLXX: Followed by the folder containing the file you want to pin.
|
||||
: /PTFILEXX: Followed by the name of the file you want to pin.
|
||||
:
|
||||
: To unpin an application or shortcut to the taskbar (replace XX with 01-10)...
|
||||
: /UTFOLXX: Followed by the folder containing the file you want to unpin.
|
||||
: /UTFILEXX: Followed by the name of the file you want to unpin.
|
||||
|
||||
: To pin an application or shortcut to the start menu (replace XX with 01-10)...
|
||||
: /PSFOLXX: Followed by the folder containing the file you want to pin.
|
||||
: /PSFILEXX: Followed by the name of the file you want to pin.
|
||||
|
||||
: To unpin an application or shortcut to the start menu (replace XX with 01-10)...
|
||||
: /USFOLXX: Followed by the folder containing the file you want to unpin.
|
||||
: /USFILEXX: Followed by the name of the file you want to unpin.
|
||||
|
||||
|
||||
: Example for pinning two shortcuts to the taskbar...
|
||||
PinTo10.exe /PTFOL01:'%USERPROFILE:%\Desktop' /PTFILE01:'Word 2016.lnk' /PTFOL02:'%USERPROFILE:%\Desktop' /PTFILE02:'Excel 2016.lnk'
|
||||
|
||||
: Example for unpinning a file to the taskbar...
|
||||
PinTo10.exe /UTFOL01:'C\Windows' /UTFILE01:'notepad.exe'
|
||||
|
||||
: Example for pinning a file to the start menu...
|
||||
PinTo10.exe /PSFOL01:'C\Windows' /PSFILE01:'notepad.exe'
|
||||
|
||||
: Example for unpinning a file from the start menu...
|
||||
PinTo10.exe /USFOL01:'%USERPROFILE:%\Desktop' /USFILE01:'Word 2016.lnk'
|
BIN
scripts/packer/floppy/WindowsPowershell.lnk
Executable file
BIN
scripts/packer/floppy/WindowsPowershell.lnk
Executable file
Binary file not shown.
26
scripts/packer/iso/README.md
Normal file
26
scripts/packer/iso/README.md
Normal file
@ -0,0 +1,26 @@
|
||||
### What Is This Directory For?
|
||||
|
||||
You should download your Windows Server ISO images from TechNet/MSDN and place them in this folder. We need to do this because MSDN / TechNet are protected by Microsoft (Live) ID, which does not support HTTP basic authentication or the OAuth2 username / password flow.
|
||||
|
||||
For example, you might want to start with one of the following:
|
||||
|
||||
* Windows Server 2008 R2 + SP1:
|
||||
* File Name: en_windows_server_2008_r2_with_sp1_x64_dvd_617601.iso
|
||||
* SHA1 Hash: D3FD7BF85EE1D5BDD72DE5B2C69A7B470733CD0A
|
||||
* Direct Download: http://msdn.microsoft.com/subscriptions/json/GetDownloadRequest?brand=MSDN&locale=en-us&fileId=44782&activexDisabled=true&akamaiDL=false
|
||||
* Windows Server 2008 R2 + SP1 (Volume License):
|
||||
* File Name: en_windows_server_2008_r2_with_sp1_vl_build_x64_dvd_617403.iso
|
||||
* SHA1 Hash: 7E7E9425041B3328CCF723A0855C2BC4F462EC57
|
||||
* Direct Download: http://msdn.microsoft.com/subscriptions/json/GetDownloadRequest?brand=MSDN&locale=en-us&fileId=44783&activexDisabled=true&akamaiDL=false
|
||||
* Windows Server 2012:
|
||||
* File Name: en_windows_server_2012_x64_dvd_915478.iso
|
||||
* SHA1 Hash: D09E752B1EE480BC7E93DFA7D5C3A9B8AAC477BA
|
||||
* Direct Download: http://msdn.microsoft.com/subscriptions/json/GetDownloadRequest?brand=MSDN&locale=en-us&fileId=50539&activexDisabled=true&akamaiDL=false
|
||||
* Windows Server 2012 (Volume License):
|
||||
* File Name: en_windows_server_2012_vl_x64_dvd_917758.iso
|
||||
* SHA1 Hash: 063BC26ED45C50D3745CCAD52DD7B3F3CE13F36D
|
||||
* Direct Download: http://msdn.microsoft.com/subscriptions/json/GetDownloadRequest?brand=MSDN&locale=en-us&fileId=50573&activexDisabled=true&akamaiDL=false
|
||||
|
||||
Or Build one using the Windows Installation Media Creation Tools:
|
||||
|
||||
https://support.microsoft.com/en-us/windows/create-installation-media-for-windows-99a58364-8c02-206f-aa6f-40c3b507420d
|
1
scripts/packer/scripts/chocolatey.bat
Normal file
1
scripts/packer/scripts/chocolatey.bat
Normal file
@ -0,0 +1 @@
|
||||
powershell -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))"
|
26
scripts/packer/scripts/chocopacks.ps1
Normal file
26
scripts/packer/scripts/chocopacks.ps1
Normal file
@ -0,0 +1,26 @@
|
||||
choco install -y boxstarter.winconfig
|
||||
|
||||
# Editors
|
||||
choco install -y notepadplusplus
|
||||
|
||||
# Terminals
|
||||
choco install -y microsoft-windows-terminal
|
||||
choco install -y fluent-terminal
|
||||
choco install -y hyper
|
||||
choco install -y tabby
|
||||
choco install -y conemu
|
||||
|
||||
# other
|
||||
choco install -y poshgit
|
||||
|
||||
# IDE/Software development
|
||||
choco install -y vscode
|
||||
choco install -y visualstudio2022community --execution-timeout 9000 --package-parameters "--add Microsoft.VisualStudio.Workload.NativeDesktop;includeRecommended"
|
||||
|
||||
md C:\users\vagrant\bin
|
||||
if (test-path "a:/set-shortcut.ps1") {
|
||||
copy "a:/set-shortcut.ps1" C:\users\vagrant\bin
|
||||
} elseif (test-path "e:/set-shortcut.ps1") {
|
||||
copy "e:/set-shortcut.ps1" C:\users\vagrant\bin
|
||||
}
|
||||
|
39
scripts/packer/scripts/compact.bat
Normal file
39
scripts/packer/scripts/compact.bat
Normal file
@ -0,0 +1,39 @@
|
||||
if "%PACKER_BUILDER_TYPE:~0,6%"=="hyperv" (
|
||||
echo "Skip compact steps in Hyper-V build."
|
||||
goto :eof
|
||||
)
|
||||
if not exist "C:\Windows\Temp\7z1900-x64.msi" (
|
||||
powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://www.7-zip.org/a/7z1900-x64.msi', 'C:\Windows\Temp\7z1900-x64.msi')" <NUL
|
||||
)
|
||||
msiexec /qb /i C:\Windows\Temp\7z1900-x64.msi
|
||||
|
||||
if not exist "C:\Windows\Temp\ultradefrag.zip" (
|
||||
powershell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (New-Object System.Net.WebClient).DownloadFile('https://downloads.sourceforge.net/project/ultradefrag/stable-release/6.1.0/ultradefrag-portable-6.1.0.bin.amd64.zip', 'C:\Windows\Temp\ultradefrag.zip')" <NUL
|
||||
)
|
||||
|
||||
if not exist "C:\Windows\Temp\ultradefrag-portable-6.1.0.amd64\udefrag.exe" (
|
||||
cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\ultradefrag.zip -oC:\Windows\Temp"
|
||||
)
|
||||
|
||||
if not exist "C:\Windows\Temp\SDelete.zip" (
|
||||
powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://download.sysinternals.com/files/SDelete.zip', 'C:\Windows\Temp\SDelete.zip')" <NUL
|
||||
powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://vagrantboxes.blob.core.windows.net/box/sdelete/v1.6.1/sdelete.exe', 'C:\Windows\Temp\sdelete.exe')" <NUL
|
||||
)
|
||||
|
||||
if not exist "C:\Windows\Temp\sdelete.exe" (
|
||||
cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\SDelete.zip -oC:\Windows\Temp"
|
||||
)
|
||||
|
||||
msiexec /qb /x C:\Windows\Temp\7z1900-x64.msi
|
||||
|
||||
net stop wuauserv
|
||||
rmdir /S /Q C:\Windows\SoftwareDistribution\Download
|
||||
mkdir C:\Windows\SoftwareDistribution\Download
|
||||
net start wuauserv
|
||||
|
||||
if "%PACKER_BUILDER_TYPE%" neq "hyperv-iso" (
|
||||
cmd /c C:\Windows\Temp\ultradefrag-portable-6.1.0.amd64\udefrag.exe --optimize --repeat C:
|
||||
|
||||
cmd /c %SystemRoot%\System32\reg.exe ADD HKCU\Software\Sysinternals\SDelete /v EulaAccepted /t REG_DWORD /d 1 /f
|
||||
cmd /c C:\Windows\Temp\sdelete.exe -q -z C:
|
||||
)
|
17
scripts/packer/scripts/compile-dotnet-assemblies.bat
Normal file
17
scripts/packer/scripts/compile-dotnet-assemblies.bat
Normal file
@ -0,0 +1,17 @@
|
||||
::http://support.microsoft.com/kb/2570538
|
||||
::http://robrelyea.wordpress.com/2007/07/13/may-be-helpful-ngen-exe-executequeueditems/
|
||||
|
||||
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto 64BIT
|
||||
|
||||
%windir%\microsoft.net\framework\v4.0.30319\ngen.exe update /force /queue > NUL
|
||||
%windir%\microsoft.net\framework\v4.0.30319\ngen.exe executequeueditems > NUL
|
||||
|
||||
exit 0
|
||||
|
||||
:64BIT
|
||||
%windir%\microsoft.net\framework\v4.0.30319\ngen.exe update /force /queue > NUL
|
||||
%windir%\microsoft.net\framework64\v4.0.30319\ngen.exe update /force /queue > NUL
|
||||
%windir%\microsoft.net\framework\v4.0.30319\ngen.exe executequeueditems > NUL
|
||||
%windir%\microsoft.net\framework64\v4.0.30319\ngen.exe executequeueditems > NUL
|
||||
|
||||
exit 0
|
33
scripts/packer/scripts/debloat-windows.ps1
Normal file
33
scripts/packer/scripts/debloat-windows.ps1
Normal file
@ -0,0 +1,33 @@
|
||||
if ($env:PACKER_BUILDER_TYPE -And $($env:PACKER_BUILDER_TYPE).startsWith("hyperv")) {
|
||||
Write-Output Skip debloat steps in Hyper-V build.
|
||||
}
|
||||
else {
|
||||
Write-Output Downloading debloat zip
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
$url = "https://github.com/StefanScherer/Debloat-Windows-10/archive/master.zip"
|
||||
(New-Object System.Net.WebClient).DownloadFile($url, "$env:TEMP\debloat.zip")
|
||||
Expand-Archive -Path $env:TEMP\debloat.zip -DestinationPath $env:TEMP -Force
|
||||
|
||||
#Write-Output Disable scheduled tasks
|
||||
#. $env:TEMP\Debloat-Windows-10-master\utils\disable-scheduled-tasks.ps1
|
||||
#Write-Output Block telemetry
|
||||
#. $env:TEMP\Debloat-Windows-10-master\scripts\block-telemetry.ps1
|
||||
#Write-Output Disable services
|
||||
#. $env:TEMP\Debloat-Windows-10-master\scripts\disable-services.ps1
|
||||
Write-Output Disable Windows Defender
|
||||
if ($(Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").ProductName.StartsWith("Windows 10")) {
|
||||
. $env:TEMP\Debloat-Windows-10-master\scripts\disable-windows-defender.ps1
|
||||
}
|
||||
else {
|
||||
Uninstall-WindowsFeature Windows-Defender
|
||||
}
|
||||
Write-Output Optimize Windows Update
|
||||
. $env:TEMP\Debloat-Windows-10-master\scripts\optimize-windows-update.ps1
|
||||
#Write-Output Disable Windows Update
|
||||
#Set-Service wuauserv -StartupType Disabled
|
||||
#Write-Output Remove OneDrive
|
||||
#. $env:TEMP\Debloat-Windows-10-master\scripts\remove-onedrive.ps1
|
||||
|
||||
Remove-Item $env:TEMP\debloat.zip
|
||||
Remove-Item -recurse $env:TEMP\Debloat-Windows-10-master
|
||||
}
|
20
scripts/packer/scripts/dis-updates.bat
Normal file
20
scripts/packer/scripts/dis-updates.bat
Normal file
@ -0,0 +1,20 @@
|
||||
rem http://www.windows-commandline.com/disable-automatic-updates-command-line/
|
||||
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v AUOptions /t REG_DWORD /d 1 /f
|
||||
|
||||
rem remove optional WSUS server settings
|
||||
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /f
|
||||
|
||||
rem even harder, disable windows update service
|
||||
rem sc config wuauserv start= disabled
|
||||
rem net stop wuauserv
|
||||
set logfile=C:\Windows\Temp\win-updates.log
|
||||
|
||||
if exist %logfile% (
|
||||
echo Show Windows Updates log file %logfile%
|
||||
dir %logfile%
|
||||
type %logfile%
|
||||
rem output of type command is not fully shown in packer/ssh session, so try PowerShell
|
||||
rem but it will hang if log file is about 22 KByte
|
||||
rem powershell -command "Get-Content %logfile%"
|
||||
echo End of Windows Updates log file %logfile%
|
||||
)
|
4
scripts/packer/scripts/disable-screensaver.ps1
Normal file
4
scripts/packer/scripts/disable-screensaver.ps1
Normal file
@ -0,0 +1,4 @@
|
||||
Write-Output "Disabling Screensaver"
|
||||
Set-ItemProperty "HKCU:\Control Panel\Desktop" -Name ScreenSaveActive -Value 0 -Type DWord
|
||||
& powercfg -x -monitor-timeout-ac 0
|
||||
& powercfg -x -monitor-timeout-dc 0
|
8
scripts/packer/scripts/disable-winrm.ps1
Normal file
8
scripts/packer/scripts/disable-winrm.ps1
Normal file
@ -0,0 +1,8 @@
|
||||
netsh advfirewall firewall set rule name="Windows Remote Management (HTTP-In)" new enable=yes action=block
|
||||
netsh advfirewall firewall set rule group="Windows Remote Management" new enable=yes
|
||||
$winrmService = Get-Service -Name WinRM
|
||||
if ($winrmService.Status -eq "Running") {
|
||||
Disable-PSRemoting -Force
|
||||
}
|
||||
Stop-Service winrm
|
||||
Set-Service -Name winrm -StartupType Disabled
|
@ -0,0 +1,4 @@
|
||||
$DefenderInstalled = Get-Command -Module Defender
|
||||
if($null -ne $DefenderInstalled) {
|
||||
Set-MpPreference -DisableRealtimeMonitoring $true
|
||||
}
|
2
scripts/packer/scripts/enable-rdp.bat
Normal file
2
scripts/packer/scripts/enable-rdp.bat
Normal file
@ -0,0 +1,2 @@
|
||||
netsh advfirewall firewall add rule name="Open Port 3389" dir=in action=allow protocol=TCP localport=3389
|
||||
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
|
27
scripts/packer/scripts/enable-winrm.ps1
Normal file
27
scripts/packer/scripts/enable-winrm.ps1
Normal file
@ -0,0 +1,27 @@
|
||||
write-host "==> 'enable-winrm.ps1' - START..."
|
||||
write-host "====> Getting Connections..."
|
||||
Get-NetConnectionProfile | Set-NetConnectionProfile -NetworkCategory Private
|
||||
|
||||
write-host "====> Enable PSRemoting..."
|
||||
Enable-PSRemoting -Force
|
||||
|
||||
write-host "====> WINRM Quick Config..."
|
||||
winrm quickconfig -q
|
||||
winrm quickconfig -transport:http
|
||||
|
||||
write-host "====> WINRM Set Config..."
|
||||
winrm set winrm/config '@{MaxTimeoutms="1800000"}'
|
||||
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="800"}'
|
||||
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
|
||||
winrm set winrm/config/service/auth '@{Basic="true"}'
|
||||
winrm set winrm/config/client/auth '@{Basic="true"}'
|
||||
winrm set winrm/config/listener?Address=*+Transport=HTTP '@{Port="5985"}'
|
||||
|
||||
write-host "====> Configure Firewall..."
|
||||
netsh advfirewall firewall set rule group="Windows Remote Administration" new enable=yes
|
||||
netsh advfirewall firewall set rule name="Windows Remote Management (HTTP-In)" new enable=yes action=allow remoteip=any
|
||||
write-host "====> Set WINRM Service Statup..."
|
||||
Set-Service winrm -startuptype "auto"
|
||||
write-host "====> Restart WINRM Service..."
|
||||
Restart-Service winrm
|
||||
write-host "==> 'enable-winrm.ps1' - END..."
|
30
scripts/packer/scripts/fixnetwork.ps1
Normal file
30
scripts/packer/scripts/fixnetwork.ps1
Normal file
@ -0,0 +1,30 @@
|
||||
# You cannot enable Windows PowerShell Remoting on network connections that are set to Public
|
||||
# Spin through all the network locations and if they are set to Public, set them to Private
|
||||
# using the INetwork interface:
|
||||
# http://msdn.microsoft.com/en-us/library/windows/desktop/aa370750(v=vs.85).aspx
|
||||
# For more info, see:
|
||||
# http://blogs.msdn.com/b/powershell/archive/2009/04/03/setting-network-location-to-private.aspx
|
||||
|
||||
function Set-NetworkTypeToPrivate {
|
||||
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPositionalParameters', '')]
|
||||
param()
|
||||
# Network location feature was only introduced in Windows Vista - no need to bother with this
|
||||
# if the operating system is older than Vista
|
||||
if ([environment]::OSVersion.version.Major -lt 6) { return }
|
||||
|
||||
# You cannot change the network location if you are joined to a domain, so abort
|
||||
if (1, 3, 4, 5 -contains (Get-CimInstance win32_computersystem).DomainRole) { return }
|
||||
|
||||
# Get network connections
|
||||
$networkListManager = [Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]"{DCB00C01-570F-4A9B-8D69-199FDBA5723B}"))
|
||||
$connections = $networkListManager.GetNetworkConnections()
|
||||
|
||||
$connections | ForEach-Object {
|
||||
Write-Output $_.GetNetwork().GetName() "category was previously set to" $_.GetNetwork().GetCategory()
|
||||
#$_.GetNetwork().SetCategory(1)
|
||||
Write-Output $_.GetNetwork().GetName() "changed to category" $_.GetNetwork().GetCategory()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Set-NetworkTypeToPrivate
|
12
scripts/packer/scripts/microsoft-updates.bat
Normal file
12
scripts/packer/scripts/microsoft-updates.bat
Normal file
@ -0,0 +1,12 @@
|
||||
net stop wuauserv
|
||||
|
||||
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v EnableFeaturedSoftware /t REG_DWORD /d 1 /f
|
||||
|
||||
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v IncludeRecommendedUpdates /t REG_DWORD /d 1 /f
|
||||
|
||||
echo Set ServiceManager = CreateObject("Microsoft.Update.ServiceManager") > "%temp%\temp.vbs"
|
||||
echo Set NewUpdateService = ServiceManager.AddService2("7971f918-a847-4430-9279-4a52d1efe18d",7,"") >> "%temp%\temp.vbs"
|
||||
|
||||
cscript "%temp%\temp.vbs"
|
||||
|
||||
net start wuauserv
|
12
scripts/packer/scripts/microsoft-updates.ps1
Normal file
12
scripts/packer/scripts/microsoft-updates.ps1
Normal file
@ -0,0 +1,12 @@
|
||||
Stop-Service -Name 'wuauserv'
|
||||
|
||||
Set-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update' -Name 'EnableFeaturedSoftware' -Value 1 -Type DWord
|
||||
Set-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update' -Name 'IncludeRecommendedUpdates' -Value 1 -Type DWord
|
||||
|
||||
"Set ServiceManager = CreateObject(""Microsoft.Update.ServiceManager"")" | Out-File -FilePath 'C:\temp.vbs'
|
||||
"Set NewUpdateService = ServiceManager.AddService2(""7971f918-a847-4430-9279-4a52d1efe18d"",7,"""")" | Out-File -FilePath 'C:\temp.vbs' -Append
|
||||
|
||||
cscript C:\temp.vbs
|
||||
Remove-Item -Path 'C:\temp.vbs' -Force
|
||||
|
||||
Start-Service -Name 'wuauserv'
|
16
scripts/packer/scripts/pin-powershell.bat
Normal file
16
scripts/packer/scripts/pin-powershell.bat
Normal file
@ -0,0 +1,16 @@
|
||||
rem https://connect.microsoft.com/PowerShell/feedback/details/1609288/pin-to-taskbar-no-longer-working-in-windows-10
|
||||
|
||||
set ps_link=A:\WindowsPowerShell.lnk
|
||||
if exist e:\WindowsPowerShell.lnk (
|
||||
set ps_link=e:\WindowsPowerShell.lnk
|
||||
)
|
||||
|
||||
set pin_to_10=A:\PinTo10.exe
|
||||
if exist e:\PinTo10.exe (
|
||||
set pin_to_10=e:\PinTo10.exe
|
||||
)
|
||||
|
||||
|
||||
copy "%ps_link%" "%TEMP%\Windows PowerShell.lnk"
|
||||
%pin_to_10% /PTFOL01:'%TEMP%' /PTFILE01:'Windows PowerShell.lnk'
|
||||
exit /b 0
|
19
scripts/packer/scripts/set-powerplan.ps1
Normal file
19
scripts/packer/scripts/set-powerplan.ps1
Normal file
@ -0,0 +1,19 @@
|
||||
Try {
|
||||
Write-Output "Set power plan to high performance"
|
||||
|
||||
$HighPerf = powercfg -l | ForEach-Object { if ($_.contains("High performance")) { $_.split()[3] } }
|
||||
|
||||
# $HighPerf cannot be $null, we try activate this power profile with powercfg
|
||||
if ($null -eq $HighPerf) {
|
||||
throw "Error: HighPerf is null"
|
||||
}
|
||||
|
||||
$CurrPlan = $(powercfg -getactivescheme).split()[3]
|
||||
|
||||
if ($CurrPlan -ne $HighPerf) { powercfg -setactive $HighPerf }
|
||||
|
||||
}
|
||||
Catch {
|
||||
Write-Warning -Message "Unable to set power plan to high performance"
|
||||
Write-Warning $Error[0]
|
||||
}
|
21
scripts/packer/scripts/set-shortcut.ps1
Normal file
21
scripts/packer/scripts/set-shortcut.ps1
Normal file
@ -0,0 +1,21 @@
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[Parameter()]
|
||||
[string]$SourceExe,
|
||||
[string]$Arguments,
|
||||
[string]$DestinationPath,
|
||||
[string]$WorkingDirectory,
|
||||
[String]$IconLocation
|
||||
)
|
||||
|
||||
if ($IconLocation -eq '') {
|
||||
$IconLocation = $SourceExe
|
||||
}
|
||||
|
||||
$WshShell = New-Object -comObject WScript.Shell
|
||||
$Shortcut = $WshShell.CreateShortcut($destinationPath)
|
||||
$Shortcut.TargetPath = $SourceExe
|
||||
$Shortcut.Arguments = $Arguments
|
||||
$shortcut.WorkingDirectory = $WorkingDirectory
|
||||
$shortcut.IconLocation = $IconLocation
|
||||
$Shortcut.Save()
|
2
scripts/packer/scripts/set-winrm-automatic.bat
Normal file
2
scripts/packer/scripts/set-winrm-automatic.bat
Normal file
@ -0,0 +1,2 @@
|
||||
echo Set WinRM start type to auto
|
||||
sc config winrm start= auto
|
1
scripts/packer/scripts/uac-enable.bat
Normal file
1
scripts/packer/scripts/uac-enable.bat
Normal file
@ -0,0 +1 @@
|
||||
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /f /v EnableLUA /t REG_DWORD /d 1
|
96
scripts/packer/scripts/vm-guest-tools.ps1
Normal file
96
scripts/packer/scripts/vm-guest-tools.ps1
Normal file
@ -0,0 +1,96 @@
|
||||
if (!( Test-Path "C:\Windows\Temp\7z1900-x64.msi")) {
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (New-Object System.Net.WebClient).DownloadFile('https://www.7-zip.org/a/7z1900-x64.msi', 'C:\Windows\Temp\7z1900-x64.msi')
|
||||
}
|
||||
if (!(Test-Path "C:\Windows\Temp\7z1900-x64.msi")) {
|
||||
Start-Sleep 5; [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (New-Object System.Net.WebClient).DownloadFile('https://www.7-zip.org/a/7z1900-x64.msi', 'C:\Windows\Temp\7z1900-x64.msi')
|
||||
}
|
||||
cmd /c msiexec /qb /i C:\Windows\Temp\7z1900-x64.msi
|
||||
|
||||
if ("$env:PACKER_BUILDER_TYPE" -eq "vmware-iso") {
|
||||
|
||||
Write-Output "Using VMware"
|
||||
if (Test-Path "C:\Users\vagrant\windows.iso") {
|
||||
Move-Item -force C:\Users\vagrant\windows.iso C:\Windows\Temp
|
||||
}
|
||||
|
||||
if (!(Test-Path "C:\Windows\Temp\windows.iso")) {
|
||||
Try {
|
||||
# Disabling the progress bar speeds up IWR https://github.com/PowerShell/PowerShell/issues/2138
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
$pageContentLinks = (Invoke-WebRequest('https://softwareupdate.vmware.com/cds/vmw-desktop/ws') -UseBasicParsing).Links | where-object { $_.href -Match "[0-9]" } | Select-Object href | ForEach-Object { $_.href.Trim('/') }
|
||||
$versionObject = $pageContentLinks | ForEach-Object { new-object System.Version ($_) } | sort-object -Descending | select-object -First 1 -Property:Major, Minor, Build
|
||||
$newestVersion = $versionObject.Major.ToString() + "." + $versionObject.Minor.ToString() + "." + $versionObject.Build.ToString() | out-string
|
||||
$newestVersion = $newestVersion.TrimEnd("`r?`n")
|
||||
|
||||
$nextURISubdirectoryObject = (Invoke-WebRequest("https://softwareupdate.vmware.com/cds/vmw-desktop/ws/$newestVersion/") -UseBasicParsing).Links | where-object { $_.href -Match "[0-9]" } | Select-Object href | where-object { $_.href -Match "[0-9]" }
|
||||
$nextUriSubdirectory = $nextURISubdirectoryObject.href | Out-String
|
||||
$nextUriSubdirectory = $nextUriSubdirectory.TrimEnd("`r?`n")
|
||||
$newestVMwareToolsURL = "https://softwareupdate.vmware.com/cds/vmw-desktop/ws/$newestVersion/$nextURISubdirectory/windows/packages/tools-windows.tar"
|
||||
Write-Output "The latest version of VMware tools has been determined to be downloadable from $newestVMwareToolsURL"
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (New-Object System.Net.WebClient).DownloadFile("$newestVMwareToolsURL", 'C:\Windows\Temp\vmware-tools.tar')
|
||||
}
|
||||
Catch {
|
||||
Write-Output "Unable to determine the latest version of VMware tools. Falling back to hardcoded URL."
|
||||
(New-Object System.Net.WebClient).DownloadFile('https://softwareupdate.vmware.com/cds/vmw-desktop/ws/15.5.5/16285975/windows/packages/tools-windows.tar', 'C:\Windows\Temp\vmware-tools.tar')
|
||||
}
|
||||
cmd /c "C:\PROGRA~1\7-Zip\7z.exe" x C:\Windows\Temp\vmware-tools.tar -oC:\Windows\Temp
|
||||
Move-Item c:\windows\temp\VMware-tools-windows-*.iso c:\windows\temp\windows.iso
|
||||
Try { Remove-Item "C:\Program Files (x86)\VMWare" -Recurse -Force -ErrorAction Stop } Catch { Write-Output "Directory didn't exist to be removed." }
|
||||
}
|
||||
|
||||
cmd /c "C:\PROGRA~1\7-Zip\7z.exe" x "C:\Windows\Temp\windows.iso" -oC:\Windows\Temp\VMWare
|
||||
cmd /c C:\Windows\Temp\VMWare\setup.exe /S /v"/qn REBOOT=R\"
|
||||
|
||||
Remove-Item -Force "C:\Windows\Temp\vmware-tools.tar"
|
||||
Remove-Item -Force "C:\Windows\Temp\windows.iso"
|
||||
Remove-Item -Force -Recurse "C:\Windows\Temp\VMware"
|
||||
}
|
||||
|
||||
if ("$env:PACKER_BUILDER_TYPE" -eq "virtualbox-iso") {
|
||||
Write-Output "Using Virtualbox"
|
||||
if (Test-Path "C:\Users\vagrant\VBoxGuestAdditions.iso") {
|
||||
Move-Item -Force C:\Users\vagrant\VBoxGuestAdditions.iso C:\Windows\Temp
|
||||
}
|
||||
|
||||
if (!(Test-Path "C:\Windows\Temp\VBoxGuestAdditions.iso")) {
|
||||
Try {
|
||||
$pageContentLinks = (Invoke-WebRequest('https://download.virtualbox.org/virtualbox') -UseBasicParsing).Links | where-object { $_.href -Match "[0-9]" } | Select-Object href | where-object { $_.href -NotMatch "BETA" } | where-object { $_.href -NotMatch "RC" } | where-object { $_.href -Match "[0-9]\.[0-9]" } | ForEach-Object { $_.href.Trim('/') }
|
||||
$versionObject = $pageContentLinks | ForEach-Object { new-object System.Version ($_) } | sort-object -Descending | select-object -First 1 -Property:Major, Minor, Build
|
||||
$newestVersion = $versionObject.Major.ToString() + "." + $versionObject.Minor.ToString() + "." + $versionObject.Build.ToString() | out-string
|
||||
$newestVersion = $newestVersion.TrimEnd("`r?`n")
|
||||
|
||||
$nextURISubdirectoryObject = (Invoke-WebRequest("https://download.virtualbox.org/virtualbox/$newestVersion/") -UseBasicParsing).Links | Select-Object href | where-object { $_.href -Match "GuestAdditions" }
|
||||
$nextUriSubdirectory = $nextURISubdirectoryObject.href | Out-String
|
||||
$nextUriSubdirectory = $nextUriSubdirectory.TrimEnd("`r?`n")
|
||||
$newestVboxToolsURL = "https://download.virtualbox.org/virtualbox/$newestVersion/$nextUriSubdirectory"
|
||||
Write-Output "The latest version of VirtualBox tools has been determined to be downloadable from $newestVboxToolsURL"
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (New-Object System.Net.WebClient).DownloadFile("$newestVboxToolsURL", 'C:\Windows\Temp\VBoxGuestAdditions.iso')
|
||||
}
|
||||
Catch {
|
||||
Write-Output "Unable to determine the latest version of VBox tools. Falling back to hardcoded URL."
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (New-Object System.Net.WebClient).DownloadFile('https://download.virtualbox.org/virtualbox/6.1.8/VBoxGuestAdditions_6.1.8.iso', 'C:\Windows\Temp\VBoxGuestAdditions.iso')
|
||||
}
|
||||
}
|
||||
|
||||
cmd /c ""C:\PROGRA~1\7-Zip\7z.exe" x C:\Windows\Temp\VBoxGuestAdditions.iso -oC:\Windows\Temp\virtualbox"
|
||||
Get-ChildItem "C:\Windows\Temp\virtualbox\cert\" -Filter vbox*.cer | Foreach-Object { C:\Windows\Temp\virtualbox\cert\VBoxCertUtil add-trusted-publisher $_.FullName --root $_.FullName }
|
||||
cmd /c C:\Windows\Temp\virtualbox\VBoxWindowsAdditions.exe /S
|
||||
cmd /c rd /S /Q "C:\Windows\Temp\virtualbox"
|
||||
}
|
||||
|
||||
if ("$env:PACKER_BUILDER_TYPE" -eq "parallels-iso") {
|
||||
Write-Output "Using Parallels Desktop"
|
||||
# This is required when using Parallels Desktop
|
||||
# Currently the installation of Parallels Tools is broken if you're installing in Windows Server & Windows Server Core
|
||||
# You will encounter an error in printui.dll module not found message.
|
||||
# This feature will add the required libraries for printing services.
|
||||
|
||||
# Parallels Tools is required for sync_folder to work.
|
||||
# Vagrantfile config: v.update_guest_tools = true will be installed with no issues
|
||||
if ($(Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").ProductName.StartsWith("Windows Server")) {
|
||||
Write-Output "Installing Print Server service"
|
||||
Install-WindowsFeature -Name Print-Server
|
||||
}
|
||||
}
|
||||
|
||||
cmd /c msiexec /qb /x C:\Windows\Temp\7z1900-x64.msi
|
260
scripts/packer/scripts/win-updates.ps1
Normal file
260
scripts/packer/scripts/win-updates.ps1
Normal file
@ -0,0 +1,260 @@
|
||||
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSReviewUnusedParameter', '')]
|
||||
param($global:RestartRequired = 0,
|
||||
$global:MoreUpdates = 0,
|
||||
$global:MaxCycles = 5,
|
||||
$MaxUpdatesPerCycle = 500,
|
||||
$BeginWithRestart = 0)
|
||||
|
||||
$Logfile = "C:\Windows\Temp\win-updates.log"
|
||||
|
||||
$enable_winrm_script = 'a:\enable-winrm.ps1'
|
||||
if (test-path 'e:\enable-winrm.ps1') {
|
||||
$enable_winrm_script = 'e:\enable-winrm.ps1'
|
||||
}
|
||||
|
||||
function LogWrite {
|
||||
Param ([string]$logstring)
|
||||
$now = Get-Date -format s
|
||||
Add-Content $Logfile -value "$now $logstring"
|
||||
Write-Output $logstring
|
||||
}
|
||||
|
||||
function Check-ContinueRestartOrEnd() {
|
||||
$RegistryKey = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
|
||||
$RegistryEntry = "InstallWindowsUpdates"
|
||||
switch ($global:RestartRequired) {
|
||||
0 {
|
||||
$prop = (Get-ItemProperty $RegistryKey).$RegistryEntry
|
||||
if ($prop) {
|
||||
LogWrite "Restart Registry Entry Exists - Removing It"
|
||||
Remove-ItemProperty -Path $RegistryKey -Name $RegistryEntry -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
LogWrite "No Restart Required"
|
||||
Check-WindowsUpdates
|
||||
|
||||
if (($global:MoreUpdates -eq 1) -and ($script:Cycles -le $global:MaxCycles)) {
|
||||
Install-WindowsUpdates
|
||||
}
|
||||
elseif ($script:Cycles -gt $global:MaxCycles) {
|
||||
LogWrite "Exceeded Cycle Count - Stopping"
|
||||
LogWrite "==> Running '$enable_winrm_script'..."
|
||||
& $enable_winrm_script
|
||||
}
|
||||
else {
|
||||
LogWrite "Done Installing Windows Updates"
|
||||
LogWrite "==> Running '$enable_winrm_script'..."
|
||||
& $enable_winrm_script
|
||||
}
|
||||
}
|
||||
1 {
|
||||
$prop = (Get-ItemProperty $RegistryKey).$RegistryEntry
|
||||
if (-not $prop) {
|
||||
LogWrite "Restart Registry Entry Does Not Exist - Creating It"
|
||||
Set-ItemProperty -Path $RegistryKey -Name $RegistryEntry -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File $($script:ScriptPath) -MaxUpdatesPerCycle $($MaxUpdatesPerCycle)"
|
||||
}
|
||||
else {
|
||||
LogWrite "Restart Registry Entry Exists Already"
|
||||
}
|
||||
|
||||
LogWrite "Restart Required - Restarting..."
|
||||
Restart-Computer
|
||||
}
|
||||
default {
|
||||
LogWrite "Unsure If A Restart Is Required"
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function Install-WindowsUpdates()
|
||||
{
|
||||
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', '')]
|
||||
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseSingularNouns', '')]
|
||||
param()
|
||||
$script:Cycles++
|
||||
LogWrite "Evaluating Available Updates with limit of $($MaxUpdatesPerCycle):"
|
||||
$UpdatesToDownload = New-Object -ComObject 'Microsoft.Update.UpdateColl'
|
||||
$script:i = 0;
|
||||
$CurrentUpdates = $SearchResult.Updates
|
||||
while ($script:i -lt $CurrentUpdates.Count -and $script:CycleUpdateCount -lt $MaxUpdatesPerCycle) {
|
||||
$Update = $CurrentUpdates.Item($script:i)
|
||||
if ($null -ne $Update) {
|
||||
[bool]$addThisUpdate = $false
|
||||
if ($Update.InstallationBehavior.CanRequestUserInput) {
|
||||
LogWrite "> Skipping: $($Update.Title) because it requires user input"
|
||||
}
|
||||
else {
|
||||
if (!($Update.EulaAccepted)) {
|
||||
LogWrite "> Note: $($Update.Title) has a license agreement that must be accepted. Accepting the license."
|
||||
$Update.AcceptEula()
|
||||
[bool]$addThisUpdate = $true
|
||||
$script:CycleUpdateCount++
|
||||
}
|
||||
else {
|
||||
[bool]$addThisUpdate = $true
|
||||
$script:CycleUpdateCount++
|
||||
}
|
||||
}
|
||||
|
||||
if ([bool]$addThisUpdate) {
|
||||
LogWrite "Adding: $($Update.Title)"
|
||||
$UpdatesToDownload.Add($Update) | Out-Null
|
||||
}
|
||||
}
|
||||
$script:i++
|
||||
}
|
||||
|
||||
if ($UpdatesToDownload.Count -eq 0) {
|
||||
LogWrite "No Updates To Download..."
|
||||
}
|
||||
else {
|
||||
LogWrite 'Downloading Updates...'
|
||||
$ok = 0;
|
||||
while (! $ok) {
|
||||
try {
|
||||
$Downloader = $UpdateSession.CreateUpdateDownloader()
|
||||
$Downloader.Updates = $UpdatesToDownload
|
||||
$Downloader.Download()
|
||||
$ok = 1;
|
||||
}
|
||||
catch {
|
||||
LogWrite $_.Exception | Format-List -force
|
||||
LogWrite "Error downloading updates. Retrying in 30s."
|
||||
$script:attempts = $script:attempts + 1
|
||||
Start-Sleep -s 30
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$UpdatesToInstall = New-Object -ComObject 'Microsoft.Update.UpdateColl'
|
||||
[bool]$rebootMayBeRequired = $false
|
||||
LogWrite 'The following updates are downloaded and ready to be installed:'
|
||||
foreach ($Update in $SearchResult.Updates) {
|
||||
if (($Update.IsDownloaded)) {
|
||||
LogWrite "> $($Update.Title)"
|
||||
$UpdatesToInstall.Add($Update) | Out-Null
|
||||
|
||||
if ($Update.InstallationBehavior.RebootBehavior -gt 0) {
|
||||
[bool]$rebootMayBeRequired = $true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($UpdatesToInstall.Count -eq 0) {
|
||||
LogWrite 'No updates available to install...'
|
||||
$global:MoreUpdates = 0
|
||||
$global:RestartRequired = 0
|
||||
LogWrite "==> Running '$enable_winrm_script'..."
|
||||
& $enable_winrm_script
|
||||
break
|
||||
}
|
||||
|
||||
if ($rebootMayBeRequired) {
|
||||
LogWrite 'These updates may require a reboot'
|
||||
$global:RestartRequired = 1
|
||||
}
|
||||
|
||||
LogWrite 'Installing updates...'
|
||||
|
||||
$Installer = $script:UpdateSession.CreateUpdateInstaller()
|
||||
$Installer.Updates = $UpdatesToInstall
|
||||
$InstallationResult = $Installer.Install()
|
||||
|
||||
LogWrite "Installation Result: $($InstallationResult.ResultCode)"
|
||||
LogWrite "Reboot Required: $($InstallationResult.RebootRequired)"
|
||||
LogWrite 'Listing of updates installed and individual installation results:'
|
||||
if ($InstallationResult.RebootRequired) {
|
||||
$global:RestartRequired = 1
|
||||
}
|
||||
else {
|
||||
$global:RestartRequired = 0
|
||||
}
|
||||
|
||||
for ($i = 0; $i -lt $UpdatesToInstall.Count; $i++) {
|
||||
New-Object -TypeName PSObject -Property @{
|
||||
Title = $UpdatesToInstall.Item($i).Title
|
||||
Result = $InstallationResult.GetUpdateResult($i).ResultCode
|
||||
}
|
||||
LogWrite "Item: $($UpdatesToInstall.Item($i).Title)"
|
||||
LogWrite "Result: $($InstallationResult.GetUpdateResult($i).ResultCode)"
|
||||
}
|
||||
|
||||
Check-ContinueRestartOrEnd
|
||||
}
|
||||
|
||||
function Check-WindowsUpdates() {
|
||||
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', '')]
|
||||
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseSingularNouns', '')]
|
||||
param()
|
||||
LogWrite "Checking For Windows Updates"
|
||||
$Username = $env:USERDOMAIN + "\" + $env:USERNAME
|
||||
LogWrite "Script: $script:ScriptPath `nScript User: $Username `nStarted: $(Get-Date)"
|
||||
|
||||
$script:UpdateSearcher = $script:UpdateSession.CreateUpdateSearcher()
|
||||
$script:successful = $FALSE
|
||||
$script:attempts = 0
|
||||
$script:maxAttempts = 12
|
||||
while (-not $script:successful -and $script:attempts -lt $script:maxAttempts) {
|
||||
try {
|
||||
$script:SearchResult = $script:UpdateSearcher.Search("IsInstalled=0 and Type='Software' and IsHidden=0")
|
||||
$script:successful = $TRUE
|
||||
}
|
||||
catch {
|
||||
LogWrite $_.Exception | Format-List -force
|
||||
LogWrite "Search call to UpdateSearcher was unsuccessful. Retrying in 10s."
|
||||
$script:attempts = $script:attempts + 1
|
||||
Start-Sleep -s 10
|
||||
}
|
||||
}
|
||||
|
||||
if ($SearchResult.Updates.Count -ne 0) {
|
||||
$Message = "There are " + $SearchResult.Updates.Count + " more updates."
|
||||
LogWrite $Message
|
||||
try {
|
||||
for ($i = 0; $i -lt $script:SearchResult.Updates.Count; $i++) {
|
||||
LogWrite $script:SearchResult.Updates.Item($i).Title
|
||||
LogWrite $script:SearchResult.Updates.Item($i).Description
|
||||
LogWrite $script:SearchResult.Updates.Item($i).RebootRequired
|
||||
LogWrite $script:SearchResult.Updates.Item($i).EulaAccepted
|
||||
}
|
||||
$global:MoreUpdates = 1
|
||||
}
|
||||
catch {
|
||||
LogWrite $_.Exception | Format-List -force
|
||||
LogWrite "Showing SearchResult was unsuccessful. Rebooting."
|
||||
$global:RestartRequired = 1
|
||||
$global:MoreUpdates = 0
|
||||
Check-ContinueRestartOrEnd
|
||||
LogWrite "Show never happen to see this text!"
|
||||
Restart-Computer
|
||||
}
|
||||
}
|
||||
else {
|
||||
LogWrite 'There are no applicable updates'
|
||||
$global:RestartRequired = 0
|
||||
$global:MoreUpdates = 0
|
||||
}
|
||||
}
|
||||
|
||||
$script:ScriptName = $MyInvocation.MyCommand.ToString()
|
||||
$script:ScriptPath = $MyInvocation.MyCommand.Path
|
||||
$script:UpdateSession = New-Object -ComObject 'Microsoft.Update.Session'
|
||||
$script:UpdateSession.ClientApplicationID = 'Packer Windows Update Installer'
|
||||
$script:UpdateSearcher = $script:UpdateSession.CreateUpdateSearcher()
|
||||
$script:SearchResult = New-Object -ComObject 'Microsoft.Update.UpdateColl'
|
||||
$script:Cycles = 0
|
||||
$script:CycleUpdateCount = 0
|
||||
|
||||
if ($BeginWithRestart) {
|
||||
$global:RestartRequired = 1
|
||||
Check-ContinueRestartOrEnd
|
||||
}
|
||||
|
||||
Check-WindowsUpdates
|
||||
if ($global:MoreUpdates -eq 1) {
|
||||
Install-WindowsUpdates
|
||||
}
|
||||
else {
|
||||
Check-ContinueRestartOrEnd
|
||||
}
|
91
scripts/packer/vagrantfile-windows_10.template
Normal file
91
scripts/packer/vagrantfile-windows_10.template
Normal file
@ -0,0 +1,91 @@
|
||||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
Vagrant.require_version ">= 1.6.2"
|
||||
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.define "vagrant-windows-10-preview"
|
||||
config.vm.box = "windows_10_preview"
|
||||
config.vm.communicator = "winrm"
|
||||
|
||||
# Admin user name and password
|
||||
config.winrm.username = "vagrant"
|
||||
config.winrm.password = "vagrant"
|
||||
|
||||
config.vm.guest = :windows
|
||||
config.windows.halt_timeout = 15
|
||||
|
||||
config.vm.network :forwarded_port, guest: 3389, host: 3389, id: "rdp", auto_correct: true
|
||||
|
||||
config.vm.provider :virtualbox do |v, override|
|
||||
#v.gui = true
|
||||
v.customize ["modifyvm", :id, "--memory", 2048]
|
||||
v.customize ["modifyvm", :id, "--cpus", 2]
|
||||
v.customize ["modifyvm", :id, "--vram", 128]
|
||||
v.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
|
||||
v.customize ["setextradata", "global", "GUI/SuppressMessages", "all" ]
|
||||
end
|
||||
|
||||
config.vm.provider :vmware_fusion do |v, override|
|
||||
v.gui = true
|
||||
v.vmx["memsize"] = "2048"
|
||||
v.vmx["numvcpus"] = "2"
|
||||
v.vmx["ethernet0.virtualDev"] = "vmxnet3"
|
||||
v.vmx["RemoteDisplay.vnc.enabled"] = "false"
|
||||
v.vmx["RemoteDisplay.vnc.port"] = "5900"
|
||||
v.vmx["scsi0.virtualDev"] = "lsisas1068"
|
||||
v.vmx["gui.fitguestusingnativedisplayresolution"] = "TRUE"
|
||||
v.vmx["mks.enable3d"] = "TRUE"
|
||||
v.vmx["mks.forceDiscreteGPU"] = "TRUE"
|
||||
v.vmx["gui.fullscreenatpoweron"] = "TRUE"
|
||||
v.vmx["gui.viewmodeatpoweron"] = "fullscreen"
|
||||
v.vmx["gui.lastPoweredViewMode"] = "fullscreen"
|
||||
v.vmx["sound.startconnected"] = "FALSE"
|
||||
v.vmx["sound.present"] = "FALSE"
|
||||
v.vmx["sound.autodetect"] = "TRUE"
|
||||
v.enable_vmrun_ip_lookup = false
|
||||
v.whitelist_verified = true
|
||||
v.vmx["hgfs.linkRootShare"] = "FALSE"
|
||||
end
|
||||
|
||||
config.vm.provider :vmware_workstation do |v, override|
|
||||
v.gui = true
|
||||
v.vmx["memsize"] = "2048"
|
||||
v.vmx["numvcpus"] = "2"
|
||||
v.vmx["ethernet0.virtualDev"] = "vmxnet3"
|
||||
v.vmx["RemoteDisplay.vnc.enabled"] = "false"
|
||||
v.vmx["RemoteDisplay.vnc.port"] = "5900"
|
||||
v.vmx["scsi0.virtualDev"] = "lsisas1068"
|
||||
v.enable_vmrun_ip_lookup = false
|
||||
v.whitelist_verified = true
|
||||
v.vmx["hgfs.linkRootShare"] = "FALSE"
|
||||
end
|
||||
|
||||
config.vm.provider "hyperv" do |v|
|
||||
v.cpus = 2
|
||||
v.maxmemory = 2048
|
||||
v.linked_clone = true
|
||||
end
|
||||
|
||||
config.vm.provider :libvirt do |libvirt, override|
|
||||
libvirt.memory = 2048
|
||||
libvirt.cpus = 2
|
||||
|
||||
# Use WinRM for the default synced folder; or disable it if
|
||||
# WinRM is not available. Linux hosts don't support SMB,
|
||||
# and Windows guests don't support NFS/9P/rsync
|
||||
# See https://github.com/Cimpress-MCP/vagrant-winrm-syncedfolders
|
||||
if Vagrant.has_plugin?("vagrant-winrm-syncedfolders")
|
||||
override.vm.synced_folder ".", "/vagrant", type: "winrm"
|
||||
else
|
||||
override.vm.synced_folder ".", "/vagrant", disabled: true
|
||||
end
|
||||
|
||||
# Enable Hyper-V enlightments, see
|
||||
# https://blog.wikichoon.com/2014/07/enabling-hyper-v-enlightenments-with-kvm.html
|
||||
libvirt.hyperv_feature :name => 'stimer', :state => 'on'
|
||||
libvirt.hyperv_feature :name => 'relaxed', :state => 'on'
|
||||
libvirt.hyperv_feature :name => 'vapic', :state => 'on'
|
||||
libvirt.hyperv_feature :name => 'synic', :state => 'on'
|
||||
end
|
||||
end
|
230
scripts/packer/windows_10.json
Normal file
230
scripts/packer/windows_10.json
Normal file
@ -0,0 +1,230 @@
|
||||
{
|
||||
"builders": [
|
||||
{
|
||||
"boot_command": ["a<wait>a<wait>a"],
|
||||
"boot_wait": "-1s",
|
||||
"cd_files": [
|
||||
"{{user `autounattend`}}",
|
||||
"./floppy/WindowsPowershell.lnk",
|
||||
"./floppy/PinTo10.exe",
|
||||
"./scripts/fixnetwork.ps1",
|
||||
"./scripts/disable-screensaver.ps1",
|
||||
"./scripts/disable-winrm.ps1",
|
||||
"./scripts/enable-winrm.ps1",
|
||||
"./scripts/microsoft-updates.ps1",
|
||||
"./scripts/win-updates.ps1",
|
||||
"./scripts/set-shortcut.ps1"
|
||||
],
|
||||
"communicator": "winrm",
|
||||
"configuration_version": "10.0",
|
||||
"cpus": "{{user `cpus`}}",
|
||||
"disk_size": "{{user `disk_size`}}",
|
||||
"enable_dynamic_memory": false,
|
||||
"enable_mac_spoofing": true,
|
||||
"enable_secure_boot": true,
|
||||
"enable_virtualization_extensions": true,
|
||||
"generation": "2",
|
||||
"guest_additions_mode": "disable",
|
||||
"iso_checksum": "{{user `iso_checksum`}}",
|
||||
"iso_url": "{{user `iso_url`}}",
|
||||
"memory": "{{user `memory`}}",
|
||||
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
|
||||
"switch_name": "Default Switch",
|
||||
"type": "hyperv-iso",
|
||||
"vm_name": "{{user `vm_name`}}",
|
||||
"winrm_password": "vagrant",
|
||||
"winrm_timeout": "{{ user `winrm_timeout` }}",
|
||||
"winrm_username": "vagrant"
|
||||
},
|
||||
{
|
||||
"boot_command": ["a<wait>a<wait>a"],
|
||||
"boot_wait": "-1s",
|
||||
"cd_files": [
|
||||
"{{user `autounattend`}}",
|
||||
"./floppy/WindowsPowershell.lnk",
|
||||
"./floppy/PinTo10.exe",
|
||||
"./scripts/fixnetwork.ps1",
|
||||
"./scripts/disable-screensaver.ps1",
|
||||
"./scripts/disable-winrm.ps1",
|
||||
"./scripts/enable-winrm.ps1",
|
||||
"./scripts/microsoft-updates.ps1",
|
||||
"./scripts/win-updates.ps1",
|
||||
"./scripts/set-shortcut.ps1"
|
||||
],
|
||||
"communicator": "winrm",
|
||||
"cpus": "{{user `cpus`}}",
|
||||
"disk_adapter_type": "lsisas1068",
|
||||
"disk_size": "{{user `disk_size`}}",
|
||||
"disk_type_id": "1",
|
||||
"guest_os_type": "windows9-64",
|
||||
"headless": "{{user `headless`}}",
|
||||
"iso_checksum": "{{user `iso_checksum`}}",
|
||||
"iso_url": "{{user `iso_url`}}",
|
||||
"memory": "{{user `memory`}}",
|
||||
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
|
||||
"type": "vmware-iso",
|
||||
"version": "19",
|
||||
"vm_name": "{{user `vm_name`}}",
|
||||
"vmx_data": {
|
||||
"firmware": "efi",
|
||||
"RemoteDisplay.vnc.enabled": "false",
|
||||
"RemoteDisplay.vnc.port": "5900"
|
||||
},
|
||||
"vmx_remove_ethernet_interfaces": true,
|
||||
"vnc_port_max": 5980,
|
||||
"vnc_port_min": 5900,
|
||||
"winrm_password": "vagrant",
|
||||
"winrm_timeout": "{{ user `winrm_timeout` }}",
|
||||
"winrm_username": "vagrant"
|
||||
},
|
||||
{
|
||||
"boot_command": ["a<wait>a<wait>a"],
|
||||
"boot_wait": "-1s",
|
||||
"cd_files": [
|
||||
"{{user `autounattend`}}",
|
||||
"./floppy/WindowsPowershell.lnk",
|
||||
"./floppy/PinTo10.exe",
|
||||
"./scripts/fixnetwork.ps1",
|
||||
"./scripts/disable-screensaver.ps1",
|
||||
"./scripts/disable-winrm.ps1",
|
||||
"./scripts/enable-winrm.ps1",
|
||||
"./scripts/microsoft-updates.ps1",
|
||||
"./scripts/win-updates.ps1",
|
||||
"./scripts/set-shortcut.ps1"
|
||||
],
|
||||
"communicator": "winrm",
|
||||
"cpus": "{{user `cpus`}}",
|
||||
"disk_size": "{{user `disk_size`}}",
|
||||
"firmware": "efi",
|
||||
"guest_additions_mode": "disable",
|
||||
"guest_os_type": "Windows10_64",
|
||||
"headless": "{{user `headless`}}",
|
||||
"iso_checksum": "{{user `iso_checksum`}}",
|
||||
"iso_url": "{{user `iso_url`}}",
|
||||
"memory": "{{user `memory`}}",
|
||||
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
|
||||
"type": "virtualbox-iso",
|
||||
"vm_name": "{{user `vm_name`}}",
|
||||
"winrm_password": "vagrant",
|
||||
"winrm_timeout": "{{ user `winrm_timeout` }}",
|
||||
"winrm_username": "vagrant"
|
||||
},
|
||||
{
|
||||
"boot_command": "",
|
||||
"boot_wait": "6m",
|
||||
"communicator": "winrm",
|
||||
"cpus": "{{user `cpus`}}",
|
||||
"disk_size": "{{user `disk_size`}}",
|
||||
"floppy_files": [
|
||||
"{{user `autounattend`}}",
|
||||
"./floppy/WindowsPowershell.lnk",
|
||||
"./floppy/PinTo10.exe",
|
||||
"./scripts/fixnetwork.ps1",
|
||||
"./scripts/disable-screensaver.ps1",
|
||||
"./scripts/disable-winrm.ps1",
|
||||
"./scripts/enable-winrm.ps1",
|
||||
"./scripts/microsoft-updates.ps1",
|
||||
"./scripts/win-updates.ps1",
|
||||
"./scripts/set-shortcut.ps1"
|
||||
],
|
||||
"guest_os_type": "win-10",
|
||||
"iso_checksum": "{{user `iso_checksum`}}",
|
||||
"iso_url": "{{user `iso_url`}}",
|
||||
"memory": "{{user `memory`}}",
|
||||
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
|
||||
"type": "parallels-iso",
|
||||
"parallels_tools_flavor": "win",
|
||||
"prlctl": [
|
||||
[
|
||||
"set",
|
||||
"{{.Name}}",
|
||||
"--efi-boot",
|
||||
"off"
|
||||
]
|
||||
],
|
||||
"vm_name": "{{user `vm_name`}}",
|
||||
"winrm_password": "vagrant",
|
||||
"winrm_timeout": "{{ user `winrm_timeout` }}",
|
||||
"winrm_username": "vagrant"
|
||||
}
|
||||
],
|
||||
"post-processors": [
|
||||
{
|
||||
"keep_input_artifact": false,
|
||||
"output": "cmderdev-10_{{.Provider}}.box",
|
||||
"type": "vagrant",
|
||||
"vagrantfile_template": "vagrantfile-windows_10.template"
|
||||
}
|
||||
],
|
||||
"provisioners": [
|
||||
{
|
||||
"execute_command": "{{ .Vars }} cmd /c \"{{ .Path }}\"",
|
||||
"remote_path": "/tmp/script.bat",
|
||||
"scripts": [
|
||||
"./scripts/enable-rdp.bat"
|
||||
],
|
||||
"type": "windows-shell"
|
||||
},
|
||||
{
|
||||
"scripts": [
|
||||
"./scripts/vm-guest-tools.ps1",
|
||||
"./scripts/debloat-windows.ps1"
|
||||
],
|
||||
"type": "powershell"
|
||||
},
|
||||
{
|
||||
"restart_timeout": "{{user `restart_timeout`}}",
|
||||
"type": "windows-restart"
|
||||
},
|
||||
{
|
||||
"scripts": [
|
||||
"./scripts/set-powerplan.ps1",
|
||||
"./scripts/docker/disable-windows-defender.ps1"
|
||||
],
|
||||
"type": "powershell"
|
||||
},
|
||||
{
|
||||
"execute_command": "{{ .Vars }} cmd /c \"{{ .Path }}\"",
|
||||
"remote_path": "/tmp/script.bat",
|
||||
"scripts": [
|
||||
"./scripts/chocolatey.bat"
|
||||
],
|
||||
"type": "windows-shell"
|
||||
},
|
||||
{
|
||||
"scripts": [
|
||||
"./scripts/chocopacks.ps1"
|
||||
],
|
||||
"type": "powershell"
|
||||
},
|
||||
{
|
||||
"execute_command": "{{ .Vars }} cmd /c \"{{ .Path }}\"",
|
||||
"remote_path": "/tmp/script.bat",
|
||||
"scripts": [
|
||||
"./scripts/pin-powershell.bat",
|
||||
"./scripts/compile-dotnet-assemblies.bat",
|
||||
"./scripts/set-winrm-automatic.bat",
|
||||
"./scripts/uac-enable.bat",
|
||||
"./scripts/dis-updates.bat",
|
||||
"./scripts/compact.bat"
|
||||
],
|
||||
"type": "windows-shell"
|
||||
}
|
||||
],
|
||||
"variables": {
|
||||
"autounattend": "./answer_files/10_efi/Autounattend.xml",
|
||||
"cpus": "2",
|
||||
"disk_size": "262144",
|
||||
"disk_type_id": "1",
|
||||
"memory": "2048",
|
||||
"headless": "false",
|
||||
"iso_url": "./iso/Windows_10.iso",
|
||||
"iso_checksum": "none",
|
||||
"restart_timeout": "5m",
|
||||
"vhv_enable": "false",
|
||||
"virtio_win_iso": "~/virtio-win.iso",
|
||||
"vm_name": "cmderdev10",
|
||||
"winrm_timeout": "6h",
|
||||
"vmx_version": "14"
|
||||
}
|
||||
}
|
249
scripts/packer/windows_11.json
Normal file
249
scripts/packer/windows_11.json
Normal file
@ -0,0 +1,249 @@
|
||||
{
|
||||
"builders": [
|
||||
{
|
||||
"boot_command": [
|
||||
"<leftShiftOn><f10><leftShiftOff><wait>",
|
||||
"reg add HKLM\\SYSTEM\\Setup\\LabConfig /t REG_DWORD /v BypassTPMCheck /d 1<return>",
|
||||
"reg add HKLM\\SYSTEM\\Setup\\LabConfig /t REG_DWORD /v BypassSecureBootCheck /d 1<return><wait>",
|
||||
"exit<return>",
|
||||
"<wait><return>"
|
||||
],
|
||||
"boot_wait": "2m",
|
||||
"communicator": "winrm",
|
||||
"configuration_version": "8.0",
|
||||
"cpus": "2",
|
||||
"disk_size": "{{user `disk_size`}}",
|
||||
"floppy_files": [
|
||||
"{{user `autounattend`}}",
|
||||
"./floppy/WindowsPowershell.lnk",
|
||||
"./floppy/PinTo10.exe",
|
||||
"./scripts/fixnetwork.ps1",
|
||||
"./scripts/disable-screensaver.ps1",
|
||||
"./scripts/disable-winrm.ps1",
|
||||
"./scripts/enable-winrm.ps1",
|
||||
"./scripts/microsoft-updates.bat",
|
||||
"./scripts/win-updates.ps1"
|
||||
],
|
||||
"guest_additions_mode": "none",
|
||||
"iso_checksum": "{{user `iso_checksum`}}",
|
||||
"iso_url": "{{user `iso_url`}}",
|
||||
"memory": "{{user `memory`}}",
|
||||
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
|
||||
"switch_name": "{{user `switch_name`}}",
|
||||
"type": "hyperv-iso",
|
||||
"vm_name": "{{user `vm_name`}}",
|
||||
"winrm_password": "vagrant",
|
||||
"winrm_timeout": "{{user `winrm_timeout`}}",
|
||||
"winrm_username": "vagrant"
|
||||
},
|
||||
{
|
||||
"boot_command": [
|
||||
"<leftShiftOn><f10><leftShiftOff><wait>",
|
||||
"reg add HKLM\\SYSTEM\\Setup\\LabConfig /t REG_DWORD /v BypassTPMCheck /d 1<return>",
|
||||
"reg add HKLM\\SYSTEM\\Setup\\LabConfig /t REG_DWORD /v BypassSecureBootCheck /d 1<return><wait>",
|
||||
"exit<return>",
|
||||
"<wait><return>"
|
||||
],
|
||||
"boot_wait": "2m",
|
||||
"communicator": "winrm",
|
||||
"cpus": 2,
|
||||
"disk_adapter_type": "lsisas1068",
|
||||
"disk_size": "{{user `disk_size`}}",
|
||||
"disk_type_id": "{{user `disk_type_id`}}",
|
||||
"floppy_files": [
|
||||
"{{user `autounattend`}}",
|
||||
"./floppy/WindowsPowershell.lnk",
|
||||
"./floppy/PinTo10.exe",
|
||||
"./scripts/fixnetwork.ps1",
|
||||
"./scripts/disable-screensaver.ps1",
|
||||
"./scripts/disable-winrm.ps1",
|
||||
"./scripts/enable-winrm.ps1",
|
||||
"./scripts/microsoft-updates.bat",
|
||||
"./scripts/win-updates.ps1"
|
||||
],
|
||||
"guest_os_type": "windows9-64",
|
||||
"headless": "{{user `headless`}}",
|
||||
"iso_checksum": "{{user `iso_checksum`}}",
|
||||
"iso_url": "{{user `iso_url`}}",
|
||||
"memory": "{{user `memory`}}",
|
||||
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
|
||||
"type": "vmware-iso",
|
||||
"version": "{{user `vmx_version`}}",
|
||||
"vm_name": "{{user `vm_name`}}",
|
||||
"vmx_data": {
|
||||
"RemoteDisplay.vnc.enabled": "false",
|
||||
"RemoteDisplay.vnc.port": "5900"
|
||||
},
|
||||
"vmx_remove_ethernet_interfaces": true,
|
||||
"vnc_port_max": 5980,
|
||||
"vnc_port_min": 5900,
|
||||
"winrm_password": "vagrant",
|
||||
"winrm_timeout": "{{user `winrm_timeout`}}",
|
||||
"winrm_username": "vagrant"
|
||||
},
|
||||
{
|
||||
"boot_command": [
|
||||
"<leftShiftOn><f10><leftShiftOff><wait>",
|
||||
"reg add HKLM\\SYSTEM\\Setup\\LabConfig /t REG_DWORD /v BypassTPMCheck /d 1<return>",
|
||||
"reg add HKLM\\SYSTEM\\Setup\\LabConfig /t REG_DWORD /v BypassSecureBootCheck /d 1<return><wait>",
|
||||
"exit<return>",
|
||||
"<wait><return>"
|
||||
],
|
||||
"boot_wait": "2m",
|
||||
"communicator": "winrm",
|
||||
"cpus": 2,
|
||||
"disk_size": "{{user `disk_size`}}",
|
||||
"floppy_files": [
|
||||
"{{user `autounattend`}}",
|
||||
"./floppy/WindowsPowershell.lnk",
|
||||
"./floppy/PinTo10.exe",
|
||||
"./scripts/fixnetwork.ps1",
|
||||
"./scripts/disable-screensaver.ps1",
|
||||
"./scripts/disable-winrm.ps1",
|
||||
"./scripts/enable-winrm.ps1",
|
||||
"./scripts/microsoft-updates.bat",
|
||||
"./scripts/win-updates.ps1"
|
||||
],
|
||||
"guest_additions_mode": "disable",
|
||||
"guest_os_type": "Windows10_64",
|
||||
"headless": "{{user `headless`}}",
|
||||
"iso_checksum": "{{user `iso_checksum`}}",
|
||||
"iso_url": "{{user `iso_url`}}",
|
||||
"memory": "{{user `memory`}}",
|
||||
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
|
||||
"type": "virtualbox-iso",
|
||||
"vm_name": "{{user `vm_name`}}",
|
||||
"winrm_password": "vagrant",
|
||||
"winrm_timeout": "{{user `winrm_timeout`}}",
|
||||
"winrm_username": "vagrant"
|
||||
},
|
||||
{
|
||||
"boot_command": [
|
||||
"<leftShiftOn><f10><leftShiftOff><wait>",
|
||||
"reg add HKLM\\SYSTEM\\Setup\\LabConfig /t REG_DWORD /v BypassTPMCheck /d 1<return>",
|
||||
"reg add HKLM\\SYSTEM\\Setup\\LabConfig /t REG_DWORD /v BypassSecureBootCheck /d 1<return><wait>",
|
||||
"exit<return>",
|
||||
"<wait><return>"
|
||||
],
|
||||
"boot_wait": "2m",
|
||||
"communicator": "winrm",
|
||||
"cpus": 2,
|
||||
"disk_size": "{{user `disk_size`}}",
|
||||
"floppy_files": [
|
||||
"{{user `autounattend`}}",
|
||||
"./floppy/WindowsPowershell.lnk",
|
||||
"./floppy/PinTo10.exe",
|
||||
"./scripts/fixnetwork.ps1",
|
||||
"./scripts/disable-screensaver.ps1",
|
||||
"./scripts/disable-winrm.ps1",
|
||||
"./scripts/enable-winrm.ps1",
|
||||
"./scripts/microsoft-updates.bat",
|
||||
"./scripts/win-updates.ps1"
|
||||
],
|
||||
"guest_os_type": "win-10",
|
||||
"iso_checksum": "{{user `iso_checksum`}}",
|
||||
"iso_url": "{{user `iso_url`}}",
|
||||
"memory": "{{user `memory`}}",
|
||||
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
|
||||
"type": "parallels-iso",
|
||||
"parallels_tools_flavor": "win",
|
||||
"parallels_tools_mode": "disable",
|
||||
"prlctl": [
|
||||
[
|
||||
"set",
|
||||
"{{.Name}}",
|
||||
"--adaptive-hypervisor",
|
||||
"on"
|
||||
],
|
||||
[
|
||||
"set",
|
||||
"{{.Name}}",
|
||||
"--efi-boot",
|
||||
"off"
|
||||
]
|
||||
],
|
||||
"vm_name": "{{user `vm_name`}}",
|
||||
"winrm_password": "vagrant",
|
||||
"winrm_timeout": "{{user `winrm_timeout`}}",
|
||||
"winrm_username": "vagrant"
|
||||
}
|
||||
],
|
||||
"post-processors": [
|
||||
{
|
||||
"keep_input_artifact": false,
|
||||
"output": "windows_11_{{.Provider}}.box",
|
||||
"type": "vagrant",
|
||||
"vagrantfile_template": "vagrantfile-windows_10.template"
|
||||
}
|
||||
],
|
||||
"provisioners": [
|
||||
{
|
||||
"execute_command": "{{ .Vars }} cmd /c \"{{ .Path }}\"",
|
||||
"remote_path": "/tmp/script.bat",
|
||||
"scripts": [
|
||||
"./scripts/enable-rdp.bat"
|
||||
],
|
||||
"type": "windows-shell"
|
||||
},
|
||||
{
|
||||
"scripts": [
|
||||
"./scripts/vm-guest-tools.ps1",
|
||||
"./scripts/debloat-windows.ps1"
|
||||
],
|
||||
"type": "powershell"
|
||||
},
|
||||
{
|
||||
"restart_timeout": "{{user `restart_timeout`}}",
|
||||
"type": "windows-restart"
|
||||
},
|
||||
{
|
||||
"scripts": [
|
||||
"./scripts/set-powerplan.ps1",
|
||||
"./scripts/docker/disable-windows-defender.ps1"
|
||||
],
|
||||
"type": "powershell"
|
||||
},
|
||||
{
|
||||
"execute_command": "{{ .Vars }} cmd /c \"{{ .Path }}\"",
|
||||
"remote_path": "/tmp/script.bat",
|
||||
"scripts": [
|
||||
"./scripts/chocolatey.bat"
|
||||
],
|
||||
"type": "windows-shell"
|
||||
},
|
||||
{
|
||||
"scripts": [
|
||||
"./scripts/chocopacks.ps1"
|
||||
],
|
||||
"type": "powershell"
|
||||
},
|
||||
{
|
||||
"execute_command": "{{ .Vars }} cmd /c \"{{ .Path }}\"",
|
||||
"remote_path": "/tmp/script.bat",
|
||||
"scripts": [
|
||||
"./scripts/pin-powershell.bat",
|
||||
"./scripts/compile-dotnet-assemblies.bat",
|
||||
"./scripts/set-winrm-automatic.bat",
|
||||
"./scripts/uac-enable.bat",
|
||||
"./scripts/dis-updates.bat",
|
||||
"./scripts/compact.bat"
|
||||
],
|
||||
"type": "windows-shell"
|
||||
}
|
||||
],
|
||||
"variables": {
|
||||
"autounattend": "./answer_files/11/Autounattend.xml",
|
||||
"disk_size": "61440",
|
||||
"disk_type_id": "1",
|
||||
"memory": "4096",
|
||||
"headless": "false",
|
||||
"iso_checksum": "sha256:e8b1d2a1a85a09b4bf6154084a8be8e3c814894a15a7bcf3e8e63fcfa9a528cb",
|
||||
"iso_url": "https://software-download.microsoft.com/download/sg/22000.194.210913-1444.co_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso",
|
||||
"restart_timeout": "5m",
|
||||
"vhv_enable": "false",
|
||||
"virtio_win_iso": "~/virtio-win.iso",
|
||||
"vm_name": "windows_11",
|
||||
"winrm_timeout": "6h",
|
||||
"vmx_version": "14"
|
||||
}
|
||||
}
|
44
scripts/vagrant/add-cmder.ps1
Normal file
44
scripts/vagrant/add-cmder.ps1
Normal file
@ -0,0 +1,44 @@
|
||||
choco install -y --force 7zip 7zip.install
|
||||
choco install -y --force cmder
|
||||
|
||||
$env:path = "$env:path;c:\tools\cmder\vendor\git-for-windows\cmd;c:\tools\cmder\vendor\git-for-windows\usr\bin;c:\tools\cmder\vendor\git-for-windows\mingw64\bin"
|
||||
c:
|
||||
cd $env:userprofile
|
||||
git clone https://github.com/cmderdev/cmder cmderdev 2>&1
|
||||
|
||||
if ("$env:USERNAME" -eq "vagrant" -and -not (test-path "$env:userprofile\cmderdev\vendor\git-for-windows")) {
|
||||
invoke-expression -command "TAKEOWN /F `"$env:userprofile\cmderdev`" /R /D y /s localhost /u vagrant /p vagrant"
|
||||
}
|
||||
|
||||
cd $env:userprofile/cmderdev
|
||||
git remote add upstream https://github.com/cmderdev/cmder
|
||||
|
||||
Install-PackageProvider -Name NuGet -Force
|
||||
install-module posh-git -force
|
||||
|
||||
cmd.exe /c "call `"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat`" && set > %temp%\vcvars.txt"
|
||||
Get-Content "$env:temp\vcvars.txt" | Foreach-Object {
|
||||
if ($_ -match "^(.*?)=(.*)$") {
|
||||
Set-Content "env:\$($matches[1])" $matches[2]
|
||||
}
|
||||
}
|
||||
|
||||
copy-item -erroraction silentlycontinue "C:\Tools\Cmder\Cmder.exe" "$env:userprofile\cmderdev"
|
||||
remove-item -erroraction silentlycontinue "$env:userprofile\cmderdev\launcher\x64\release\cmder.exe" -force
|
||||
|
||||
start-process -erroraction silentlycontinue -nonewwindow -workingdirectory "$env:userprofile\cmderdev\scripts" -filepath "powershell.exe" -argumentlist ".\build.ps1 -verbose -compile"
|
||||
|
||||
copy-item -erroraction silentlycontinue "$env:userprofile\cmderdev\launcher\x64\release\cmder.exe" "$env:userprofile\cmderdev" -force
|
||||
|
||||
# tabby
|
||||
setx cmder_root "${env:userprofile}\cmderdev"
|
||||
|
||||
# C:\Users\vagrant\AppData\Roaming\Hyper
|
||||
# // shell: '',
|
||||
# shell: 'cmd.exe',
|
||||
# // for setting shell arguments (i.e. for using interactive shellArgs: `['-i']`)
|
||||
# // by default `['--login']` will be used
|
||||
# // shellArgs: ['--login'],
|
||||
# shellArgs: ['/k', 'C:\\users\\vagrant\\cmderdev\\vendor\\init.bat'],
|
||||
|
||||
|
283
scripts/vagrant/windows_terminal_settings.json.default
Normal file
283
scripts/vagrant/windows_terminal_settings.json.default
Normal file
@ -0,0 +1,283 @@
|
||||
{
|
||||
"$help": "https://aka.ms/terminal-documentation",
|
||||
"$schema": "https://aka.ms/terminal-profiles-schema",
|
||||
"actions":
|
||||
[
|
||||
{
|
||||
"command":
|
||||
{
|
||||
"action": "copy",
|
||||
"singleLine": false
|
||||
},
|
||||
"keys": "ctrl+c"
|
||||
},
|
||||
{
|
||||
"command": "paste",
|
||||
"keys": "ctrl+v"
|
||||
},
|
||||
{
|
||||
"command": "find",
|
||||
"keys": "ctrl+shift+f"
|
||||
},
|
||||
{
|
||||
"command":
|
||||
{
|
||||
"action": "splitPane",
|
||||
"split": "auto",
|
||||
"splitMode": "duplicate"
|
||||
},
|
||||
"keys": "alt+shift+d"
|
||||
}
|
||||
],
|
||||
"copyFormatting": "none",
|
||||
"copyOnSelect": false,
|
||||
"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
|
||||
"profiles":
|
||||
{
|
||||
"defaults": {},
|
||||
"list":
|
||||
[
|
||||
{
|
||||
"commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
|
||||
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
|
||||
"hidden": false,
|
||||
"name": "Windows PowerShell"
|
||||
},
|
||||
{
|
||||
"commandline": "%SystemRoot%\\System32\\cmd.exe",
|
||||
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
|
||||
"hidden": false,
|
||||
"name": "Command Prompt"
|
||||
},
|
||||
{
|
||||
"guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
|
||||
"hidden": false,
|
||||
"name": "Azure Cloud Shell",
|
||||
"source": "Windows.Terminal.Azure"
|
||||
},
|
||||
{
|
||||
"guid": "{3b26d644-1d3b-5a0c-ab09-39d4dd9ae00e}",
|
||||
"hidden": false,
|
||||
"name": "Developer Command Prompt for VS 2022",
|
||||
"source": "Windows.Terminal.VisualStudio"
|
||||
},
|
||||
{
|
||||
"guid": "{589cd367-e65f-5e6a-a1c7-2b8d6f250da8}",
|
||||
"hidden": false,
|
||||
"name": "Developer PowerShell for VS 2022",
|
||||
"source": "Windows.Terminal.VisualStudio"
|
||||
}
|
||||
]
|
||||
},
|
||||
"schemes":
|
||||
[
|
||||
{
|
||||
"background": "#0C0C0C",
|
||||
"black": "#0C0C0C",
|
||||
"blue": "#0037DA",
|
||||
"brightBlack": "#767676",
|
||||
"brightBlue": "#3B78FF",
|
||||
"brightCyan": "#61D6D6",
|
||||
"brightGreen": "#16C60C",
|
||||
"brightPurple": "#B4009E",
|
||||
"brightRed": "#E74856",
|
||||
"brightWhite": "#F2F2F2",
|
||||
"brightYellow": "#F9F1A5",
|
||||
"cursorColor": "#FFFFFF",
|
||||
"cyan": "#3A96DD",
|
||||
"foreground": "#CCCCCC",
|
||||
"green": "#13A10E",
|
||||
"name": "Campbell",
|
||||
"purple": "#881798",
|
||||
"red": "#C50F1F",
|
||||
"selectionBackground": "#FFFFFF",
|
||||
"white": "#CCCCCC",
|
||||
"yellow": "#C19C00"
|
||||
},
|
||||
{
|
||||
"background": "#012456",
|
||||
"black": "#0C0C0C",
|
||||
"blue": "#0037DA",
|
||||
"brightBlack": "#767676",
|
||||
"brightBlue": "#3B78FF",
|
||||
"brightCyan": "#61D6D6",
|
||||
"brightGreen": "#16C60C",
|
||||
"brightPurple": "#B4009E",
|
||||
"brightRed": "#E74856",
|
||||
"brightWhite": "#F2F2F2",
|
||||
"brightYellow": "#F9F1A5",
|
||||
"cursorColor": "#FFFFFF",
|
||||
"cyan": "#3A96DD",
|
||||
"foreground": "#CCCCCC",
|
||||
"green": "#13A10E",
|
||||
"name": "Campbell Powershell",
|
||||
"purple": "#881798",
|
||||
"red": "#C50F1F",
|
||||
"selectionBackground": "#FFFFFF",
|
||||
"white": "#CCCCCC",
|
||||
"yellow": "#C19C00"
|
||||
},
|
||||
{
|
||||
"background": "#282C34",
|
||||
"black": "#282C34",
|
||||
"blue": "#61AFEF",
|
||||
"brightBlack": "#5A6374",
|
||||
"brightBlue": "#61AFEF",
|
||||
"brightCyan": "#56B6C2",
|
||||
"brightGreen": "#98C379",
|
||||
"brightPurple": "#C678DD",
|
||||
"brightRed": "#E06C75",
|
||||
"brightWhite": "#DCDFE4",
|
||||
"brightYellow": "#E5C07B",
|
||||
"cursorColor": "#FFFFFF",
|
||||
"cyan": "#56B6C2",
|
||||
"foreground": "#DCDFE4",
|
||||
"green": "#98C379",
|
||||
"name": "One Half Dark",
|
||||
"purple": "#C678DD",
|
||||
"red": "#E06C75",
|
||||
"selectionBackground": "#FFFFFF",
|
||||
"white": "#DCDFE4",
|
||||
"yellow": "#E5C07B"
|
||||
},
|
||||
{
|
||||
"background": "#FAFAFA",
|
||||
"black": "#383A42",
|
||||
"blue": "#0184BC",
|
||||
"brightBlack": "#4F525D",
|
||||
"brightBlue": "#61AFEF",
|
||||
"brightCyan": "#56B5C1",
|
||||
"brightGreen": "#98C379",
|
||||
"brightPurple": "#C577DD",
|
||||
"brightRed": "#DF6C75",
|
||||
"brightWhite": "#FFFFFF",
|
||||
"brightYellow": "#E4C07A",
|
||||
"cursorColor": "#4F525D",
|
||||
"cyan": "#0997B3",
|
||||
"foreground": "#383A42",
|
||||
"green": "#50A14F",
|
||||
"name": "One Half Light",
|
||||
"purple": "#A626A4",
|
||||
"red": "#E45649",
|
||||
"selectionBackground": "#FFFFFF",
|
||||
"white": "#FAFAFA",
|
||||
"yellow": "#C18301"
|
||||
},
|
||||
{
|
||||
"background": "#002B36",
|
||||
"black": "#002B36",
|
||||
"blue": "#268BD2",
|
||||
"brightBlack": "#073642",
|
||||
"brightBlue": "#839496",
|
||||
"brightCyan": "#93A1A1",
|
||||
"brightGreen": "#586E75",
|
||||
"brightPurple": "#6C71C4",
|
||||
"brightRed": "#CB4B16",
|
||||
"brightWhite": "#FDF6E3",
|
||||
"brightYellow": "#657B83",
|
||||
"cursorColor": "#FFFFFF",
|
||||
"cyan": "#2AA198",
|
||||
"foreground": "#839496",
|
||||
"green": "#859900",
|
||||
"name": "Solarized Dark",
|
||||
"purple": "#D33682",
|
||||
"red": "#DC322F",
|
||||
"selectionBackground": "#FFFFFF",
|
||||
"white": "#EEE8D5",
|
||||
"yellow": "#B58900"
|
||||
},
|
||||
{
|
||||
"background": "#FDF6E3",
|
||||
"black": "#002B36",
|
||||
"blue": "#268BD2",
|
||||
"brightBlack": "#073642",
|
||||
"brightBlue": "#839496",
|
||||
"brightCyan": "#93A1A1",
|
||||
"brightGreen": "#586E75",
|
||||
"brightPurple": "#6C71C4",
|
||||
"brightRed": "#CB4B16",
|
||||
"brightWhite": "#FDF6E3",
|
||||
"brightYellow": "#657B83",
|
||||
"cursorColor": "#002B36",
|
||||
"cyan": "#2AA198",
|
||||
"foreground": "#657B83",
|
||||
"green": "#859900",
|
||||
"name": "Solarized Light",
|
||||
"purple": "#D33682",
|
||||
"red": "#DC322F",
|
||||
"selectionBackground": "#FFFFFF",
|
||||
"white": "#EEE8D5",
|
||||
"yellow": "#B58900"
|
||||
},
|
||||
{
|
||||
"background": "#000000",
|
||||
"black": "#000000",
|
||||
"blue": "#3465A4",
|
||||
"brightBlack": "#555753",
|
||||
"brightBlue": "#729FCF",
|
||||
"brightCyan": "#34E2E2",
|
||||
"brightGreen": "#8AE234",
|
||||
"brightPurple": "#AD7FA8",
|
||||
"brightRed": "#EF2929",
|
||||
"brightWhite": "#EEEEEC",
|
||||
"brightYellow": "#FCE94F",
|
||||
"cursorColor": "#FFFFFF",
|
||||
"cyan": "#06989A",
|
||||
"foreground": "#D3D7CF",
|
||||
"green": "#4E9A06",
|
||||
"name": "Tango Dark",
|
||||
"purple": "#75507B",
|
||||
"red": "#CC0000",
|
||||
"selectionBackground": "#FFFFFF",
|
||||
"white": "#D3D7CF",
|
||||
"yellow": "#C4A000"
|
||||
},
|
||||
{
|
||||
"background": "#FFFFFF",
|
||||
"black": "#000000",
|
||||
"blue": "#3465A4",
|
||||
"brightBlack": "#555753",
|
||||
"brightBlue": "#729FCF",
|
||||
"brightCyan": "#34E2E2",
|
||||
"brightGreen": "#8AE234",
|
||||
"brightPurple": "#AD7FA8",
|
||||
"brightRed": "#EF2929",
|
||||
"brightWhite": "#EEEEEC",
|
||||
"brightYellow": "#FCE94F",
|
||||
"cursorColor": "#000000",
|
||||
"cyan": "#06989A",
|
||||
"foreground": "#555753",
|
||||
"green": "#4E9A06",
|
||||
"name": "Tango Light",
|
||||
"purple": "#75507B",
|
||||
"red": "#CC0000",
|
||||
"selectionBackground": "#FFFFFF",
|
||||
"white": "#D3D7CF",
|
||||
"yellow": "#C4A000"
|
||||
},
|
||||
{
|
||||
"background": "#000000",
|
||||
"black": "#000000",
|
||||
"blue": "#000080",
|
||||
"brightBlack": "#808080",
|
||||
"brightBlue": "#0000FF",
|
||||
"brightCyan": "#00FFFF",
|
||||
"brightGreen": "#00FF00",
|
||||
"brightPurple": "#FF00FF",
|
||||
"brightRed": "#FF0000",
|
||||
"brightWhite": "#FFFFFF",
|
||||
"brightYellow": "#FFFF00",
|
||||
"cursorColor": "#FFFFFF",
|
||||
"cyan": "#008080",
|
||||
"foreground": "#C0C0C0",
|
||||
"green": "#008000",
|
||||
"name": "Vintage",
|
||||
"purple": "#800080",
|
||||
"red": "#800000",
|
||||
"selectionBackground": "#FFFFFF",
|
||||
"white": "#C0C0C0",
|
||||
"yellow": "#808000"
|
||||
}
|
||||
],
|
||||
"themes": []
|
||||
}
|
9
scripts/vagrant/windows_terminal_state.json.default
Normal file
9
scripts/vagrant/windows_terminal_state.json.default
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"generatedProfiles" :
|
||||
[
|
||||
"{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
|
||||
"{589cd367-e65f-5e6a-a1c7-2b8d6f250da8}",
|
||||
"{3b26d644-1d3b-5a0c-ab09-39d4dd9ae00e}"
|
||||
],
|
||||
"settingsHash" : "6e0f2330b78337f3-01d95614596b3f65"
|
||||
}
|
131
vendor/ConEmu.xml.default
vendored
131
vendor/ConEmu.xml.default
vendored
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<key name="Software">
|
||||
<key name="ConEmu">
|
||||
<key name=".Vanilla" modified="2023-06-05 13:14:44" build="221218">
|
||||
<key name=".Vanilla" modified="2018-02-22 06:02:11" build="171109">
|
||||
<value name="ColorTable00" type="dword" data="00222827"/>
|
||||
<value name="ColorTable01" type="dword" data="009e5401"/>
|
||||
<value name="ColorTable02" type="dword" data="0004aa74"/>
|
||||
@ -42,8 +42,8 @@
|
||||
<value name="PopBackColorIdx" type="hex" data="10"/>
|
||||
<value name="ExtendFonts" type="hex" data="00"/>
|
||||
<value name="ExtendFontNormalIdx" type="hex" data="01"/>
|
||||
<value name="ExtendFontBoldIdx" type="hex" data="0C"/>
|
||||
<value name="ExtendFontItalicIdx" type="hex" data="0D"/>
|
||||
<value name="ExtendFontBoldIdx" type="hex" data="0c"/>
|
||||
<value name="ExtendFontItalicIdx" type="hex" data="0d"/>
|
||||
<value name="CursorTypeActive" type="dword" data="000232c1"/>
|
||||
<value name="CursorTypeInactive" type="dword" data="00823282"/>
|
||||
<value name="ClipboardDetectLineEnd" type="hex" data="01"/>
|
||||
@ -58,7 +58,7 @@
|
||||
<value name="TrueColorerSupport" type="hex" data="01"/>
|
||||
<value name="FadeInactive" type="hex" data="01"/>
|
||||
<value name="FadeInactiveLow" type="hex" data="00"/>
|
||||
<value name="FadeInactiveHigh" type="hex" data="C8"/>
|
||||
<value name="FadeInactiveHigh" type="hex" data="c8"/>
|
||||
<value name="ComSpec.UncPaths" type="hex" data="01"/>
|
||||
<value name="ConVisible" type="hex" data="00"/>
|
||||
<value name="ConInMode" type="dword" data="ffffffff"/>
|
||||
@ -78,6 +78,7 @@
|
||||
<value name="StartFarEditors" type="hex" data="00"/>
|
||||
<value name="StoreTaskbarkTasks" type="hex" data="00"/>
|
||||
<value name="StoreTaskbarCommands" type="hex" data="00"/>
|
||||
<value name="CmdLineHistory" type="multi"></value>
|
||||
<value name="SingleInstance" type="hex" data="00"/>
|
||||
<value name="ShowHelpTooltips" type="hex" data="01"/>
|
||||
<value name="Multi" type="hex" data="01"/>
|
||||
@ -112,13 +113,13 @@
|
||||
<value name="Monospace" type="hex" data="01"/>
|
||||
<value name="BackGround Image show" type="hex" data="00"/>
|
||||
<value name="BackGround Image" type="string" data="c:\back.bmp"/>
|
||||
<value name="bgImageDarker" type="hex" data="FF"/>
|
||||
<value name="bgImageDarker" type="hex" data="ff"/>
|
||||
<value name="bgImageColors" type="dword" data="ffffffff"/>
|
||||
<value name="bgOperation" type="hex" data="00"/>
|
||||
<value name="bgPluginAllowed" type="hex" data="01"/>
|
||||
<value name="AlphaValue" type="hex" data="F8"/>
|
||||
<value name="AlphaValue" type="hex" data="f8"/>
|
||||
<value name="AlphaValueSeparate" type="hex" data="01"/>
|
||||
<value name="AlphaValueInactive" type="hex" data="EE"/>
|
||||
<value name="AlphaValueInactive" type="hex" data="ee"/>
|
||||
<value name="UserScreenTransparent" type="hex" data="00"/>
|
||||
<value name="ColorKeyTransparent" type="hex" data="00"/>
|
||||
<value name="ColorKeyValue" type="dword" data="00010101"/>
|
||||
@ -127,8 +128,8 @@
|
||||
<value name="ConWnd Width" type="dword" data="00000078"/>
|
||||
<value name="ConWnd Height" type="dword" data="0000001e"/>
|
||||
<value name="Cascaded" type="hex" data="01"/>
|
||||
<value name="ConWnd X" type="long" data="2194"/>
|
||||
<value name="ConWnd Y" type="long" data="95"/>
|
||||
<value name="ConWnd X" type="long" data="500"/>
|
||||
<value name="ConWnd Y" type="long" data="500"/>
|
||||
<value name="16bit Height" type="ulong" data="0"/>
|
||||
<value name="AutoSaveSizePos" type="hex" data="01"/>
|
||||
<value name="IntegralSize" type="hex" data="00"/>
|
||||
@ -165,19 +166,19 @@
|
||||
<value name="CTS.ActMode" type="hex" data="02"/>
|
||||
<value name="CTS.RBtnAction" type="hex" data="03"/>
|
||||
<value name="CTS.MBtnAction" type="hex" data="00"/>
|
||||
<value name="CTS.ColorIndex" type="hex" data="E0"/>
|
||||
<value name="CTS.ColorIndex" type="hex" data="e0"/>
|
||||
<value name="ClipboardConfirmEnter" type="hex" data="01"/>
|
||||
<value name="ClipboardConfirmLonger" type="ulong" data="200"/>
|
||||
<value name="FarGotoEditorOpt" type="hex" data="01"/>
|
||||
<value name="FarGotoEditorPath" type="string" data='far.exe /e%1:%2 "%3"'/>
|
||||
<value name="FarGotoEditorPath" type="string" data="far.exe /e%1:%2 "%3""/>
|
||||
<value name="FixFarBorders" type="hex" data="01"/>
|
||||
<value name="FixFarBordersRanges" type="string" data="2013-25C4;"/>
|
||||
<value name="ExtendUCharMap" type="hex" data="01"/>
|
||||
<value name="EnhanceGraphics" type="hex" data="01"/>
|
||||
<value name="EnhanceButtons" type="hex" data="00"/>
|
||||
<value name="PartBrush75" type="hex" data="C8"/>
|
||||
<value name="PartBrush75" type="hex" data="c8"/>
|
||||
<value name="PartBrush50" type="hex" data="96"/>
|
||||
<value name="PartBrush25" type="hex" data="5A"/>
|
||||
<value name="PartBrush25" type="hex" data="5a"/>
|
||||
<value name="PartBrushBlack" type="hex" data="20"/>
|
||||
<value name="RightClick opens context menu" type="hex" data="02"/>
|
||||
<value name="RightClickMacro2" type="string" data=""/>
|
||||
@ -412,15 +413,15 @@
|
||||
<value name="Key.TileToLeft" type="dword" data="80808000"/>
|
||||
<value name="Key.TileToRIght" type="dword" data="80808000"/>
|
||||
<value name="KeyMacro01" type="dword" data="0012a031"/>
|
||||
<value name="KeyMacro01.Text" type="string" data='Task("cmd")'/>
|
||||
<value name="KeyMacro01.Text" type="string" data="Task("cmd")"/>
|
||||
<value name="KeyMacro02" type="dword" data="0012a032"/>
|
||||
<value name="KeyMacro02.Text" type="string" data='Task("PowerShell")'/>
|
||||
<value name="KeyMacro02.Text" type="string" data="Task("PowerShell")"/>
|
||||
<value name="KeyMacro03" type="dword" data="000011d0"/>
|
||||
<value name="KeyMacro03.Text" type="string" data="FontSetSize(1,2)"/>
|
||||
<value name="KeyMacro04" type="dword" data="000011d1"/>
|
||||
<value name="KeyMacro04.Text" type="string" data="FontSetSize(1,-2)"/>
|
||||
<value name="KeyMacro05" type="dword" data="0012a033"/>
|
||||
<value name="KeyMacro05.Text" type="string" data='Task("PowerShell as Admin")'/>
|
||||
<value name="KeyMacro05.Text" type="string" data="Task("PowerShell as Admin")"/>
|
||||
<value name="KeyMacro06" type="dword" data="00000000"/>
|
||||
<value name="KeyMacro06.Text" type="string" data=""/>
|
||||
<value name="KeyMacro07" type="dword" data="00000000"/>
|
||||
@ -483,12 +484,12 @@
|
||||
<value name="DndLKey" type="hex" data="00"/>
|
||||
<value name="DndRKey" type="hex" data="a2"/>
|
||||
<value name="WndDragKey" type="dword" data="00121101"/>
|
||||
<key name="Tasks" modified="2023-06-05 13:14:44" build="221218">
|
||||
<value name="Count" type="long" data="11"/>
|
||||
<key name="Tasks" modified="2018-02-22 06:02:12" build="171109">
|
||||
<value name="Count" type="long" data="9"/>
|
||||
<key name="Task1" modified="2018-02-22 06:02:12" build="171109">
|
||||
<value name="Name" type="string" data="{cmd::Cmder as Admin}"/>
|
||||
<value name="GuiArgs" type="string" data=' /icon "%CMDER_ROOT%\icons\cmder.ico"'/>
|
||||
<value name="Cmd1" type="string" data='*cmd /k ""%ConEmuDir%\..\init.bat" "'/>
|
||||
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
||||
<value name="Cmd1" type="string" data="*cmd /k ""%ConEmuDir%\..\init.bat" ""/>
|
||||
<value name="Active" type="long" data="0"/>
|
||||
<value name="Count" type="long" data="1"/>
|
||||
<value name="Hotkey" type="dword" data="00000000"/>
|
||||
@ -496,8 +497,8 @@
|
||||
</key>
|
||||
<key name="Task2" modified="2018-02-22 06:05:13" build="171109">
|
||||
<value name="Name" type="string" data="{cmd::Cmder}"/>
|
||||
<value name="GuiArgs" type="string" data=' /icon "%CMDER_ROOT%\icons\cmder.ico"'/>
|
||||
<value name="Cmd1" type="string" data='cmd /k ""%ConEmuDir%\..\init.bat" "'/>
|
||||
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
||||
<value name="Cmd1" type="string" data="cmd /k ""%ConEmuDir%\..\init.bat" ""/>
|
||||
<value name="Active" type="long" data="0"/>
|
||||
<value name="Count" type="long" data="1"/>
|
||||
<value name="Hotkey" type="dword" data="00000000"/>
|
||||
@ -506,8 +507,8 @@
|
||||
<key name="Task3" modified="2018-02-22 06:05:13" build="171109">
|
||||
<value name="Name" type="string" data="{PowerShell::PowerShell as Admin}"/>
|
||||
<value name="Hotkey" type="dword" data="00000000"/>
|
||||
<value name="GuiArgs" type="string" data=' /icon "%CMDER_ROOT%\icons\cmder.ico"'/>
|
||||
<value name="Cmd1" type="string" data='*PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression 'Import-Module ''%ConEmuDir%\..\profile.ps1'''"'/>
|
||||
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
||||
<value name="Cmd1" type="string" data="*PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression 'Import-Module ''%ConEmuDir%\..\profile.ps1'''""/>
|
||||
<value name="Active" type="long" data="0"/>
|
||||
<value name="Count" type="long" data="1"/>
|
||||
<value name="Flags" type="dword" data="00000000"/>
|
||||
@ -515,78 +516,61 @@
|
||||
<key name="Task4" modified="2018-02-22 06:05:13" build="171109">
|
||||
<value name="Name" type="string" data="{PowerShell::PowerShell}"/>
|
||||
<value name="Hotkey" type="dword" data="00000000"/>
|
||||
<value name="GuiArgs" type="string" data=' /icon "%CMDER_ROOT%\icons\cmder.ico"'/>
|
||||
<value name="Cmd1" type="string" data='PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression 'Import-Module ''%ConEmuDir%\..\profile.ps1'''"'/>
|
||||
<value name="Cmd2" type="string" data='"%CMDER_ROOT%\vendor\git-for-windows\git-bash.exe"'/>
|
||||
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
||||
<value name="Cmd1" type="string" data="PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression 'Import-Module ''%ConEmuDir%\..\profile.ps1'''""/>
|
||||
<value name="Cmd2" type="string" data=""%CMDER_ROOT%\vendor\git-for-windows\git-bash.exe""/>
|
||||
<value name="Active" type="long" data="0"/>
|
||||
<value name="Count" type="long" data="1"/>
|
||||
<value name="Flags" type="dword" data="00000000"/>
|
||||
</key>
|
||||
<key name="Task5" modified="2023-06-05 13:15:18" build="221218">
|
||||
<value name="Name" type="string" data="{bash::mintty as Admin - External}"/>
|
||||
<value name="Flags" type="dword" data="00000004"/>
|
||||
<value name="Hotkey" type="dword" data="00000000"/>
|
||||
<value name="GuiArgs" type="string" data='/icon "%ProgramFiles%\git\usr\share\git\git-for-windows.ico"'/>
|
||||
<value name="Cmd1" type="string" data='*"%ProgramFiles%\git\usr\bin\mintty.exe" /bin/bash -l'/>
|
||||
<value name="Active" type="long" data="0"/>
|
||||
<value name="Count" type="long" data="1"/>
|
||||
</key>
|
||||
<key name="Task6" modified="2023-06-05 13:15:38" build="221218">
|
||||
<value name="Name" type="string" data="{bash::mintty - External}"/>
|
||||
<value name="Flags" type="dword" data="00000004"/>
|
||||
<value name="Hotkey" type="dword" data="00000000"/>
|
||||
<value name="GuiArgs" type="string" data='/icon "%ProgramFiles%\git\usr\share\git\git-for-windows.ico"'/>
|
||||
<value name="Cmd1" type="string" data='"%ProgramFiles%\git\usr\bin\mintty.exe" /bin/bash -l'/>
|
||||
<value name="Active" type="long" data="0"/>
|
||||
<value name="Count" type="long" data="1"/>
|
||||
<value name="Cmd2" type="string" data='"%CMDER_ROOT%vendor\git-for-windows\usr\bin\mintty.exe" /bin/bash -l'/>
|
||||
</key>
|
||||
<key name="Task7" modified="2023-06-05 13:15:38" build="221218">
|
||||
<key name="Task5" modified="2018-02-22 06:05:13" build="171109">
|
||||
<value name="Name" type="string" data="{bash::mintty as Admin}"/>
|
||||
<value name="Flags" type="dword" data="00000000"/>
|
||||
<value name="Hotkey" type="dword" data="00000000"/>
|
||||
<value name="GuiArgs" type="string" data='/icon "%ConEmuDir%\..\git-for-windows\usr\share\git\git-for-windows.ico"'/>
|
||||
<value name="GuiArgs" type="string" data="/icon "%ConEmuDir%\..\git-for-windows\usr\share\git\git-for-windows.ico""/>
|
||||
<value name="Cmd1" type="string" data="*"%ConEmuDir%\..\git-for-windows\usr\bin\mintty.exe" /bin/bash -l"/>
|
||||
<value name="Active" type="long" data="0"/>
|
||||
<value name="Count" type="long" data="1"/>
|
||||
<value name="Cmd1" type="string" data='*"%ConEmuDir%\..\git-for-windows\usr\bin\mintty.exe" /bin/bash -l'/>
|
||||
</key>
|
||||
<key name="Task8" modified="2023-06-05 13:15:18" build="221218">
|
||||
<key name="Task6" modified="2018-02-22 06:05:13" build="171109">
|
||||
<value name="Name" type="string" data="{bash::mintty}"/>
|
||||
<value name="Flags" type="dword" data="00000000"/>
|
||||
<value name="Hotkey" type="dword" data="00000000"/>
|
||||
<value name="GuiArgs" type="string" data='/icon "%ConEmuDir%\..\git-for-windows\usr\share\git\git-for-windows.ico"'/>
|
||||
<value name="Cmd1" type="string" data='"%ConEmuDir%\..\git-for-windows\usr\bin\mintty.exe" /bin/bash -l'/>
|
||||
<value name="GuiArgs" type="string" data="/icon "%ConEmuDir%\..\git-for-windows\usr\share\git\git-for-windows.ico""/>
|
||||
<value name="Cmd1" type="string" data=""%ConEmuDir%\..\git-for-windows\usr\bin\mintty.exe" /bin/bash -l"/>
|
||||
<value name="Active" type="long" data="0"/>
|
||||
<value name="Count" type="long" data="1"/>
|
||||
<value name="Cmd2" type="string" data=""%CMDER_ROOT%vendor\git-for-windows\usr\bin\mintty.exe" /bin/bash -l"/>
|
||||
</key>
|
||||
<key name="Task9" modified="2023-06-05 13:14:44" build="221218">
|
||||
<key name="Task7" modified="2018-02-22 06:05:13" build="171109">
|
||||
<value name="Name" type="string" data="{bash::bash as Admin}"/>
|
||||
<value name="Flags" type="dword" data="00000000"/>
|
||||
<value name="Hotkey" type="dword" data="00000000"/>
|
||||
<value name="GuiArgs" type="string" data=' /icon "%CMDER_ROOT%\icons\cmder.ico"'/>
|
||||
<value name="Cmd1" type="string" data='*cmd /c "%ConEmuDir%\..\start_git_bash.cmd"'/>
|
||||
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
||||
<value name="Active" type="long" data="0"/>
|
||||
<value name="Count" type="long" data="1"/>
|
||||
<value name="Cmd1" type="string" data="*set "PATH=%ConEmuDir%\..\git-for-windows\usr\bin;%PATH%" & %ConEmuDir%\..\git-for-windows\git-cmd.exe --no-cd --command=%ConEmuBaseDirShort%\conemu-msys2-64.exe "%ConEmuDir%\..\git-for-windows\usr\bin\bash.exe" --login -i"/>
|
||||
</key>
|
||||
<key name="Task10" modified="2023-06-05 13:14:44" build="221218">
|
||||
<key name="Task8" modified="2018-02-22 06:05:13" build="171109">
|
||||
<value name="Name" type="string" data="{bash::bash}"/>
|
||||
<value name="Flags" type="dword" data="00000000"/>
|
||||
<value name="Hotkey" type="dword" data="00000000"/>
|
||||
<value name="GuiArgs" type="string" data=' /icon "%CMDER_ROOT%\icons\cmder.ico"'/>
|
||||
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
||||
<value name="Cmd1" type="string" data="set "PATH=%ConEmuDir%\..\git-for-windows\usr\bin;%PATH%" & %ConEmuDir%\..\git-for-windows\git-cmd.exe --no-cd --command=%ConEmuBaseDirShort%\conemu-msys2-64.exe "%ConEmuDir%\..\git-for-windows\usr\bin\bash.exe" --login -i"/>
|
||||
<value name="Active" type="long" data="0"/>
|
||||
<value name="Count" type="long" data="1"/>
|
||||
<value name="Cmd1" type="string" data='cmd /c "%ConEmuDir%\..\start_git_bash.cmd"'/>
|
||||
</key>
|
||||
<key name="Task11" modified="2023-06-05 13:14:44" build="221218">
|
||||
<key name="Task9" modified="2018-03-23 23:26:53" build="180318">
|
||||
<value name="Name" type="string" data="{WSL::bash}"/>
|
||||
<value name="Flags" type="dword" data="00000000"/>
|
||||
<value name="Hotkey" type="dword" data="00000000"/>
|
||||
<value name="GuiArgs" type="string" data='-icon "%USERPROFILE%\AppData\Local\lxss\bash.ico"'/>
|
||||
<value name="Cmd1" type="string" data='set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -cur_console:pm:/mnt'/>
|
||||
<value name="Active" type="long" data="0"/>
|
||||
<value name="Count" type="long" data="1"/>
|
||||
<value name="Cmd1" type="string" data='set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -cur_console:pm:/mnt'/>
|
||||
</key>
|
||||
</key>
|
||||
|
||||
<key name="Apps" modified="2018-02-22 06:05:13" build="171109">
|
||||
<value name="Count" type="long" data="0"/>
|
||||
</key>
|
||||
@ -692,7 +676,7 @@
|
||||
<value name="StatusBar.Hide.Dpi" type="hex" data="01"/>
|
||||
<value name="TabFlashChanged" type="long" data="8"/>
|
||||
<value name="TabModifiedSuffix" type="string" data="[*]"/>
|
||||
<key name="HotKeys" modified="2023-06-05 13:14:44" build="221218">
|
||||
<key name="HotKeys" modified="2018-02-22 06:02:12" build="171109">
|
||||
<value name="KeyMacroVersion" type="hex" data="02"/>
|
||||
<value name="Multi.Modifier" type="dword" data="00000011"/>
|
||||
<value name="Multi.ArrowsModifier" type="dword" data="0000005b"/>
|
||||
@ -861,13 +845,13 @@
|
||||
<value name="KeyMacro31.Text" type="string" data=""/>
|
||||
<value name="KeyMacro32" type="dword" data="00000000"/>
|
||||
<value name="KeyMacro32.Text" type="string" data=""/>
|
||||
<value name="CTS.VkBlock" type="hex" data="A4"/>
|
||||
<value name="CTS.VkText" type="hex" data="A0"/>
|
||||
<value name="CTS.VkBlock" type="hex" data="a4"/>
|
||||
<value name="CTS.VkText" type="hex" data="a0"/>
|
||||
<value name="CTS.VkAct" type="hex" data="00"/>
|
||||
<value name="CTS.VkPrompt" type="hex" data="00"/>
|
||||
<value name="FarGotoEditorVk" type="hex" data="A2"/>
|
||||
<value name="FarGotoEditorVk" type="hex" data="a2"/>
|
||||
<value name="DndLKey" type="hex" data="00"/>
|
||||
<value name="DndRKey" type="hex" data="A2"/>
|
||||
<value name="DndRKey" type="hex" data="a2"/>
|
||||
<value name="WndDragKey" type="dword" data="00121101"/>
|
||||
<value name="Multi.Unfasten" type="dword" data="00000000"/>
|
||||
<value name="Key.DebugProcess" type="dword" data="00105b44"/>
|
||||
@ -885,16 +869,10 @@
|
||||
<value name="Key.BufPrUp" type="dword" data="00121121"/>
|
||||
<value name="Key.BufPrDn" type="dword" data="00121122"/>
|
||||
<value name="Key.ResetTerm" type="dword" data="00000000"/>
|
||||
<value name="SetFocusParent" type="dword" data="0000a01b"/>
|
||||
<value name="CheckUpdates" type="dword" data="00105b55"/>
|
||||
<value name="Multi.NewWndConfirm" type="dword" data="00000000"/>
|
||||
<value name="CloseToRightKey" type="dword" data="00000000"/>
|
||||
<value name="Key.EditMenu" type="dword" data="00000000"/>
|
||||
<value name="Key.EditMenu2" type="dword" data="00000000"/>
|
||||
</key>
|
||||
<value name="StartCreateDelay" type="ulong" data="100"/>
|
||||
<value name="DefaultTerminalDebugLog" type="hex" data="00"/>
|
||||
<value name="LastMonitor" type="string" data="1680,0,3600,1050"/>
|
||||
<value name="LastMonitor" type="string" data="0,0,1440,1050"/>
|
||||
<value name="Restore2ActiveMon" type="hex" data="00"/>
|
||||
<value name="DownShowExOnTopMessage" type="hex" data="00"/>
|
||||
<value name="EnvironmentSet" type="multi">
|
||||
@ -924,15 +902,6 @@
|
||||
<value name="StatusBar.Hide.TMode" type="hex" data="01"/>
|
||||
<value name="StatusBar.Hide.RMode" type="hex" data="01"/>
|
||||
<value name="StatusBar.Hide.CellI" type="hex" data="01"/>
|
||||
<value name="Language" type="string" data="en"/>
|
||||
<value name="AnsiLogCodes" type="hex" data="00"/>
|
||||
<value name="ResetTerminalConfirm" type="hex" data="01"/>
|
||||
<value name="RestoreInactive" type="hex" data="00"/>
|
||||
<value name="AutoReloadEnvironment" type="hex" data="01"/>
|
||||
<value name="AutoTrimSingleLine" type="hex" data="00"/>
|
||||
<value name="StatusBar.Hide.InputGrouping" type="hex" data="00"/>
|
||||
<value name="StatusBar.Hide.WMode" type="hex" data="01"/>
|
||||
</key>
|
||||
</key>
|
||||
</key>
|
||||
|
||||
|
1
vendor/bin/add-cmderrootenvar.ps1
vendored
Normal file
1
vendor/bin/add-cmderrootenvar.ps1
vendored
Normal file
@ -0,0 +1 @@
|
||||
setx cmder_root "${env:cmder_root}"
|
36
vendor/bin/add-cmdertodesktop.ps1
vendored
Normal file
36
vendor/bin/add-cmdertodesktop.ps1
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
if (test-path "c:\windows\set-shortcut.ps1") {
|
||||
$setShortcut = "c:\windows\set-shortcut.ps1"
|
||||
}
|
||||
|
||||
if (test-path "${env:USERPROFILE}\cmderdev") {
|
||||
$env:cmder_root = "${env:USERPROFILE}\cmderdev"
|
||||
write-host "Creating '${env:USERPROFILE}\Desktop\Cmderdev.lnk'..."
|
||||
|
||||
if (test-path "${env:USERPROFILE}\cmderdev\vendor\bin\set-shortcut.ps1") {
|
||||
$setShortcut = "$env:cmder_root\vendor\bin\set-shortcut.ps1"
|
||||
}
|
||||
|
||||
start-process -NoNewWindow -filePath "powershell.exe" -ArgumentList "-file `"${setShortcut}`" -sourceexe `"${env:cmder_root}\Cmder.exe`" -DestinationPath `"${env:USERPROFILE}\Desktop\Cmderdev.lnk`" -WorkingDirectory `"${env:cmder_root}`""
|
||||
}
|
||||
|
||||
if (test-path "${env:USERPROFILE}\cmder") {
|
||||
$env:cmder_root = "${env:USERPROFILE}\cmder"
|
||||
|
||||
if (test-path "${cmder_root}\vendor\bin\set-shortcut.ps1") {
|
||||
$setShortcut = "$env:cmder_root\vendor\bin\set-shortcut.ps1"
|
||||
}
|
||||
|
||||
write-host "Creating '${env:USERPROFILE}\Desktop\Cmder.lnk'..."
|
||||
start-process -NoNewWindow -filePath "powershell.exe" -ArgumentList "-file `"${setShortcut}`" -sourceexe `"$env:cmder_root\Cmder.exe`" -DestinationPath `"${env:USERPROFILE}\Desktop\Cmder.lnk`" -WorkingDirectory `"${env:USERPROFILE}`""
|
||||
} elseif (test-path "C:\tools\cmder") {
|
||||
$env:cmder_root = "C:\tools\cmder"
|
||||
|
||||
if (test-path "${cmder_root}\vendor\bin\set-shortcut.ps1") {
|
||||
$setShortcut = "$env:cmder_root\vendor\bin\set-shortcut.ps1"
|
||||
}
|
||||
|
||||
write-host "Creating '${env:USERPROFILE}\Desktop\Cmder.lnk'..."
|
||||
start-process -NoNewWindow -filePath "powershell.exe" -ArgumentList "-file `"${setShortcut}`" -sourceexe `"$env:cmder_root\Cmder.exe`" -DestinationPath `"${env:USERPROFILE}\Desktop\Cmder.lnk`" -WorkingDirectory `"${env:USERPROFILE}`""
|
||||
}
|
||||
|
||||
|
39
vendor/bin/add-vscodeprofile.ps1
vendored
Normal file
39
vendor/bin/add-vscodeprofile.ps1
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
# VSCode
|
||||
$VSCodeUserSettings = "$env:APPDATA/Code/User"
|
||||
$VSCodeSettings = "$VSCodeUserSettings/settings.json";
|
||||
$VSCodeSettingsNew = $VSCodeSettings.replace('.json', '-new.json')
|
||||
|
||||
if (test-path $VSCodeSettings) {
|
||||
$data = get-content -path $VSCodeSettings -ErrorAction silentlycontinue | out-string | ConvertFrom-Json
|
||||
}
|
||||
else {
|
||||
New-Item -ItemType directory $VSCodeUserSettings -force
|
||||
$data = @{}
|
||||
}
|
||||
|
||||
write-host $data
|
||||
|
||||
$data | Add-Member -force -Name 'terminal.integrated.defaultProfile.windows' -MemberType NoteProperty -Value "Cmder"
|
||||
|
||||
if ($null -eq $data.'terminal.integrated.profiles.windows') {
|
||||
write-host "Adding 'terminal.integrated.profiles.windows'..."
|
||||
$data | Add-Member -force -Name 'terminal.integrated.profiles.windows' -MemberType NoteProperty -Value @{}
|
||||
}
|
||||
|
||||
write-host "Adding 'terminal.integrated.profiles.windows.Cmder' profile..."
|
||||
$data.'terminal.integrated.profiles.windows'.'Cmder' = @{
|
||||
"name" = "Cmder";
|
||||
"path" = @(
|
||||
"`${env:windir}/Sysnative/cmd.exe";
|
||||
"`${env:windir}/System32/cmd.exe";
|
||||
);
|
||||
"args" = @(
|
||||
"/k";
|
||||
"`${env:USERPROFILE}/cmderdev/vendor/bin/vscode_init.cmd");
|
||||
"icon" = "terminal-cmd";
|
||||
"color" = "terminal.ansiGreen";
|
||||
};
|
||||
|
||||
$data | ConvertTo-Json -depth 100 | set-content $VSCodeSettings
|
||||
|
||||
|
74
vendor/bin/add-windowsterminalprofiles.ps1
vendored
Normal file
74
vendor/bin/add-windowsterminalprofiles.ps1
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
# Windows Terminal
|
||||
$windowsTerminalFolder = (dir "$env:userprofile/AppData/Local/Packages/Microsoft.WindowsTerminal_*").name
|
||||
$windowsTerminalPath = "$env:userprofile/AppData/Local/Packages/$windowsTerminalFolder"
|
||||
$windowsTerminalSettings = $windowsTerminalPath + '/localState/settings.json'
|
||||
$windowsTerminalSettingsNew = $windowsTerminalPath + '/localState/settings-new.json'
|
||||
|
||||
if (test-path "$env:userprofile/Documents/windows_terminal_settings.json.default") {
|
||||
if (test-path "$windowsTerminalPath/LocalState/settings.json") {
|
||||
del "$env:userprofile/Documents/windows_terminal_settings.json.default"
|
||||
} else {
|
||||
move-item -path $env:userprofile/Documents/windows_terminal_settings.json.default -destination $windowsTerminalPath/LocalState/settings.json
|
||||
}
|
||||
}
|
||||
|
||||
if (test-path "$env:userprofile/Documents/windows_terminal_state.json.default") {
|
||||
if (test-path "$windowsTerminalPath/LocalState/state.json") {
|
||||
del "$env:userprofile/Documents/windows_terminal_state.json.default"
|
||||
} else {
|
||||
move-item -path $env:userprofile/Documents/windows_terminal_state.json.default -destination $windowsTerminalPath/LocalState/state.json
|
||||
}
|
||||
}
|
||||
|
||||
if (test-path "$windowsTerminalPath/LocalState/state.json") {
|
||||
$json = get-content $windowsTerminalSettings | ConvertFrom-Json
|
||||
|
||||
$json.defaultProfile="{00000000-0000-0000-ba54-000000000132}"
|
||||
|
||||
$cmderFound = $false
|
||||
$cmderAsAdminFound = $false
|
||||
|
||||
foreach ($profile in $json.profiles.list) {
|
||||
if ($profile.Name -eq "Cmder") {
|
||||
$cmderFound = $true
|
||||
}
|
||||
elseIf ($profile.Name -eq "Cmder as Admin") {
|
||||
$cmderAsAdminFound = $true
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $cmderFound) {
|
||||
write-host "Adding 'Cmder' to Windows Terminal..."
|
||||
|
||||
$json.profiles.list += @{
|
||||
commandline="cmd.exe /k `"%USERPROFILE%/cmderdev/vendor/init.bat`"";
|
||||
startingDirectory="%USERPROFILE%/cmderdev";
|
||||
icon="%USERPROFILE%/cmderdev/icons/cmder.ico";
|
||||
closeOnExit="graceful";
|
||||
guid="{00000000-0000-0000-ba54-000000000132}";
|
||||
hidden=$false;
|
||||
name="Cmder"
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $cmderAsAdminFound) {
|
||||
write-host "Adding 'Cmder as Admin' to Windows Terminal..."
|
||||
|
||||
$json.profiles.list += @{
|
||||
commandline="cmd.exe /k `"%USERPROFILE%/cmderdev/vendor/init.bat`"";
|
||||
startingDirectory="%USERPROFILE%/cmderdev";
|
||||
icon="%USERPROFILE%/cmderdev/icons/cmder_red.ico";
|
||||
closeOnExit="graceful";
|
||||
guid="{00000000-0000-0000-ba54-000000000133}";
|
||||
hidden=$false;
|
||||
elevate=$true;
|
||||
name="Cmder as Admin"
|
||||
}
|
||||
}
|
||||
|
||||
$json | ConvertTo-Json -depth 100 | set-content $windowsTerminalSettings
|
||||
}
|
||||
else {
|
||||
write-host "Cannot add profiles for Windows Terminal. The Windows Terminal settings file does not exist!"
|
||||
}
|
||||
|
4
vendor/bin/cmder_diag.cmd
vendored
4
vendor/bin/cmder_diag.cmd
vendored
@ -2,9 +2,9 @@
|
||||
|
||||
(echo.
|
||||
echo ------------------------------------
|
||||
echo Get Cmder env variables...
|
||||
echo set
|
||||
echo ------------------------------------
|
||||
set | findstr -i -r "^aliases= architecture_bits ccall= cexec= ^clink_ ^cmder ^debug_output= fast_init= ^GIT_INSTALL_ROOT= ^git_locale= ^HOME= ^max_depth= ^nix_tools= ^path_position= ^path= ^PLINK_PROTOCOL= ^print_ ^SVN_SSH= ^time_init= ^user_aliases= ^verbose_output="
|
||||
set
|
||||
|
||||
echo.
|
||||
echo ------------------------------------
|
||||
|
2
vendor/bin/cmder_shell.cmd
vendored
2
vendor/bin/cmder_shell.cmd
vendored
@ -9,5 +9,5 @@ if "%cmder_init%" == "1" (
|
||||
)
|
||||
|
||||
pushd "%CMDER_ROOT%"
|
||||
call "%CMDER_ROOT%\vendor\init.bat" /f %*
|
||||
call "%CMDER_ROOT%\vendor\init.bat" /f
|
||||
popd
|
||||
|
3
vendor/bin/create-cmdercfg.cmd
vendored
3
vendor/bin/create-cmdercfg.cmd
vendored
@ -1,3 +0,0 @@
|
||||
@echo off
|
||||
|
||||
powershell -executionpolicy bypass -f "%cmder_root%\vendor\bin\create-cmdercfg.ps1" -shell cmd -outfile "%CMDER_CONFIG_DIR%\user_init.cmd"
|
30
vendor/bin/create-cmdercfg.ps1
vendored
30
vendor/bin/create-cmdercfg.ps1
vendored
@ -1,30 +0,0 @@
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[Parameter()]
|
||||
[string]$shell = 'cmd',
|
||||
[string]$outfile = "$env:cmder_config_dir\user_init.cmd"
|
||||
)
|
||||
|
||||
if ($shell -match 'powershell') {
|
||||
write-host "'$shell' is not supported at this time!"
|
||||
exit 0
|
||||
} elseif ($shell -match 'bash') {
|
||||
write-host "'$shell' is not supported at this time!"
|
||||
exit 0
|
||||
} elseif ($shell -notMatch 'cmd') {
|
||||
exit 0
|
||||
}
|
||||
|
||||
$CmderModulePath = Join-path $env:cmder_root "vendor/psmodules/"
|
||||
$CmderFunctions = Join-Path $CmderModulePath "Cmder.ps1"
|
||||
|
||||
. $CmderFunctions
|
||||
|
||||
if ($shell -match 'cmd') {
|
||||
write-host "Generating Cmder Config for '$shell' shell in '$outfile'..."
|
||||
templateExpand "$env:cmder_root\vendor\user_init.cmd.template" "$outfile"
|
||||
} elseif ($shell -match 'powershell') {
|
||||
write-host "'$shell' is not supported at this time!"
|
||||
} elseif ($shell -match 'bash') {
|
||||
write-host "'$shell' is not supported at this time!"
|
||||
}
|
14
vendor/bin/excd.cmd
vendored
14
vendor/bin/excd.cmd
vendored
@ -1,8 +1,6 @@
|
||||
@echo off
|
||||
set excd=%*
|
||||
set excd=%excd:"=%
|
||||
set excd_param=/d
|
||||
if /i "%excd:~0,2%"=="/d" set "excd=%excd:~2%"
|
||||
if "%excd:~0,1%"=="~" (set excd=%userprofile%\%excd:~1%)
|
||||
if "%excd:~0,1%"=="/" (set excd_param=)
|
||||
cd %excd_param% %excd%
|
||||
@if "%~1"=="/?" (@cd %*)
|
||||
@set excd=%*
|
||||
@set excd=%excd:"=%
|
||||
@if "%excd:~0,1%"=="~" (@set excd=%userprofile%\%excd:~1%)
|
||||
@if not "%~1"=="/d" (@set excd_param="/d") else (@set excd_param=)
|
||||
@cd %excd_param% "%excd%"
|
||||
|
21
vendor/bin/set-shortcut.ps1
vendored
Normal file
21
vendor/bin/set-shortcut.ps1
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[Parameter()]
|
||||
[string]$SourceExe,
|
||||
[string]$Arguments,
|
||||
[string]$DestinationPath,
|
||||
[string]$WorkingDirectory,
|
||||
[String]$IconLocation
|
||||
)
|
||||
|
||||
if ($IconLocation -eq '') {
|
||||
$IconLocation = $SourceExe
|
||||
}
|
||||
|
||||
$WshShell = New-Object -comObject WScript.Shell
|
||||
$Shortcut = $WshShell.CreateShortcut($destinationPath)
|
||||
$Shortcut.TargetPath = $SourceExe
|
||||
$Shortcut.Arguments = $Arguments
|
||||
$shortcut.WorkingDirectory = $WorkingDirectory
|
||||
$shortcut.IconLocation = $IconLocation
|
||||
$Shortcut.Save()
|
24
vendor/bin/timer.cmd
vendored
24
vendor/bin/timer.cmd
vendored
@ -11,7 +11,6 @@ set /a hours=%end_h%-%start_h%
|
||||
set /a mins=%end_m%-%start_m%
|
||||
set /a secs=%end_s%-%start_s%
|
||||
set /a ms=%end_ms%-%start_ms%
|
||||
|
||||
if %ms% lss 0 set /a secs = %secs% - 1 & set /a ms = 100%ms%
|
||||
if %secs% lss 0 set /a mins = %mins% - 1 & set /a secs = 60%secs%
|
||||
if %mins% lss 0 set /a hours = %hours% - 1 & set /a mins = 60%mins%
|
||||
@ -21,26 +20,3 @@ if 1%ms% lss 100 set ms=0%ms%
|
||||
:: Mission accomplished
|
||||
set /a totalsecs = %hours%*3600 + %mins%*60 + %secs%
|
||||
echo Elapsed Time: %hours%:%mins%:%secs%.%ms% (%totalsecs%.%ms%s total)
|
||||
|
||||
:: cleanup
|
||||
set start=
|
||||
set end=
|
||||
set options=
|
||||
|
||||
set start_h=
|
||||
set start_m=
|
||||
set start_s=
|
||||
set start_ms=
|
||||
|
||||
set end_h=
|
||||
set end_m=
|
||||
set end_s=
|
||||
set end_ms=
|
||||
|
||||
set hours=
|
||||
set mins=
|
||||
set secs=
|
||||
set ms=
|
||||
|
||||
set totalsecs=
|
||||
|
||||
|
4
vendor/clink.lua
vendored
4
vendor/clink.lua
vendored
@ -692,10 +692,6 @@ for _,lua_module in ipairs(clink.find_files(completions_dir..'*.lua')) do
|
||||
end
|
||||
end
|
||||
|
||||
-- If Cmder is launched with '/c [folderPath]', indicating Cmder is installed globally and
|
||||
-- each user has a private '[folderPath]\config' folder, Clink won't know about the global
|
||||
-- '%cmder_root%\config dir, so we need to load scripts from there before . Clink loads lua
|
||||
-- scripts from the profile directory given to it when it was injected.
|
||||
if clink.get_env('CMDER_USER_CONFIG') then
|
||||
local cmder_config_dir = clink.get_env('CMDER_ROOT')..'/config/'
|
||||
for _,lua_module in ipairs(clink.find_files(cmder_config_dir..'*.lua')) do
|
||||
|
4
vendor/clink_settings.default
vendored
4
vendor/clink_settings.default
vendored
@ -1,10 +1,6 @@
|
||||
# For explanation of these and other settings see:
|
||||
# https://chrisant996.github.io/clink/clink.html
|
||||
|
||||
# name: Expand envvars when completing
|
||||
# type: boolean
|
||||
match.expand_envvars = True
|
||||
|
||||
# name: Sets how command history expansion is applied
|
||||
# type: enum
|
||||
# options: off,on,not_squoted,not_dquoted,not_quoted
|
||||
|
6
vendor/cmder.sh
vendored
6
vendor/cmder.sh
vendored
@ -22,11 +22,7 @@ function runProfiled {
|
||||
}
|
||||
|
||||
# We do this for bash as admin sessions since $CMDER_ROOT is not being set
|
||||
if [ -z "$CMDER_ROOT" ] && [ -n "$cmder_root" ] ; then
|
||||
export CMDER_ROOT=$(cygpath -u $cmder_root)
|
||||
fi
|
||||
|
||||
if [ -z "$CMDER_ROOT" ] ; then
|
||||
if [ "$CMDER_ROOT" == "" ] ; then
|
||||
case "$ConEmuDir" in *\\*) CMDER_ROOT=$( cd "$(cygpath -u "$ConEmuDir")/../.." ; pwd );; esac
|
||||
else
|
||||
case "$CMDER_ROOT" in *\\*) CMDER_ROOT="$(cygpath -u "$CMDER_ROOT")";; esac
|
||||
|
19
vendor/cmder_exinit
vendored
19
vendor/cmder_exinit
vendored
@ -26,14 +26,15 @@ function runProfiled {
|
||||
unset profile_d_scripts
|
||||
pushd "${1}" >/dev/null
|
||||
|
||||
if [ -n "${ZSH_VERSION}" ]; then
|
||||
if [ ! "x${ZSH_VERSION}" = "x" ]; then
|
||||
profile_d_scripts=$(ls *.zsh 2>/dev/null)
|
||||
elif [ -n "${BASH_VERSION}" ]; then
|
||||
elif [ ! "x${BASH_VERSION}" = "x" ]; then
|
||||
profile_d_scripts=$(ls *.sh 2>/dev/null)
|
||||
fi
|
||||
|
||||
if [ -n "${profile_d_scripts}" ] ; then
|
||||
if [ ! "x${profile_d_scripts}" = "x" ] ; then
|
||||
for x in ${profile_d_scripts} ; do
|
||||
echo Sourcing "${1}/${x}"...
|
||||
. "${1}/${x}"
|
||||
done
|
||||
fi
|
||||
@ -43,23 +44,23 @@ function runProfiled {
|
||||
# Check that we haven't already been sourced.
|
||||
[[ -z ${CMDER_EXINIT} ]] && CMDER_EXINIT="1" || return
|
||||
|
||||
if [ -z "$CMDER_ROOT" ] && [ -n "$cmder_root" ] ; then
|
||||
export CMDER_ROOT=$(cygpath -u $cmder_root)
|
||||
fi
|
||||
|
||||
# We do this for bash as admin sessions since $CMDER_ROOT is not being set
|
||||
if [ "$CMDER_ROOT" = "" -a "$ConEmuDir" != "" ] ; then
|
||||
if [ -d "${ConEmuDir}/../../vendor" ] ; then
|
||||
if [ -d "${ConEmuDir}../../vendor" ] ; then
|
||||
case "$ConEmuDir" in *\\*) CMDER_ROOT=$( cd "$(cygpath -u "$ConEmuDir")/../.." ; pwd );; esac
|
||||
else
|
||||
echo "Running in ConEmu without Cmder, skipping Cmder integration."
|
||||
fi
|
||||
elif [ "$CMDER_ROOT" != "" ] ; then
|
||||
case "$CMDER_ROOT" in *\\*) CMDER_ROOT="$(cygpath -u "$CMDER_ROOT")";; esac
|
||||
fi
|
||||
|
||||
if [ -n "$CMDER_ROOT" ] ; then
|
||||
if [ ! "$CMDER_ROOT" = "" ] ; then
|
||||
# Remove any trailing '/'
|
||||
CMDER_ROOT=$(echo $CMDER_ROOT | sed 's:/*$::')
|
||||
|
||||
echo "Using \"CMDER_ROOT\" at \"${CMDER_ROOT}\"."
|
||||
|
||||
export CMDER_ROOT
|
||||
|
||||
PATH=${CMDER_ROOT}/bin:${CMDER_ROOT}/vendor/bin:$PATH:${CMDER_ROOT}
|
||||
|
10
vendor/cmder_prompt_config.lua.default
vendored
10
vendor/cmder_prompt_config.lua.default
vendored
@ -48,15 +48,15 @@ prompt_overrideSvnStatusOptIn = false
|
||||
-- Colors: https://github.com/cmderdev/cmder/wiki/Customization#list-of-colors
|
||||
-- Effects: https://github.com/cmderdev/cmder/wiki/Customization#list-of-effects
|
||||
--
|
||||
-- Green: "\x1b[1;32;49m"
|
||||
-- Yellow: "\x1b[1;33;49m"
|
||||
-- Green: "\x1b[1;33;49m"
|
||||
-- Yellow: "\x1b[1;32;49m"
|
||||
-- Light Grey: "\x1b[1;30;49m"
|
||||
|
||||
-- Prompt Element Colors
|
||||
uah_color = "\x1b[1;33;49m" -- Yellow uah = [user]@[hostname]
|
||||
cwd_color = "\x1b[1;32;49m" -- Green cwd = Current Working Directory
|
||||
uah_color = "\x1b[1;33;49m" -- Green = uah = [user]@[hostname]
|
||||
cwd_color = "\x1b[1;32;49m" -- Yellow cwd = Current Working Directory
|
||||
lamb_color = "\x1b[1;30;49m" -- Light Grey = Lambda Color
|
||||
clean_color = "\x1b[37;1m"
|
||||
dirty_color = "\x1b[33;3m" -- Yellow, Italic
|
||||
conflict_color = "\x1b[31;1m" -- Red, Bold
|
||||
unknown_color = "\x1b[37;1m" -- White, Bold = No VCS Status Branch Color
|
||||
unknown_color = "\x1b[37;1m" -- White = No VCS Status Branch Color
|
||||
|
68
vendor/git-prompt.sh
vendored
68
vendor/git-prompt.sh
vendored
@ -1,35 +1,26 @@
|
||||
# Returns 1 if git status for Cmder is disabled, otherwise returns 0
|
||||
function getGitStatusSetting() {
|
||||
local gitConfig
|
||||
gitStatusSetting=$(git --no-pager config -l 2>/dev/null)
|
||||
|
||||
# Get all git config entries for the current repository without pager
|
||||
gitConfig=$(git --no-pager config -l 2>/dev/null) || return 0 # treat failure as enabled
|
||||
|
||||
# Check if git status for Cmder is disabled
|
||||
if [[ $gitConfig =~ (^|$'\n')cmder\.status=false($|$'\n') ]] || \
|
||||
[[ $gitConfig =~ (^|$'\n')cmder\.shstatus=false($|$'\n') ]]
|
||||
if [[ -n ${gitStatusSetting} ]] && [[ ${gitStatusSetting} =~ cmder.status=false ]] || [[ ${gitStatusSetting} =~ cmder.shstatus=false ]]
|
||||
then
|
||||
return 1 # disabled
|
||||
echo false
|
||||
else
|
||||
echo true
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
# Prints current branch or detached HEAD short commit hash
|
||||
function getSimpleGitBranch() {
|
||||
local gitDir
|
||||
gitDir=$(git rev-parse --git-dir 2>/dev/null) || return 0
|
||||
gitDir=$(git rev-parse --git-dir 2>/dev/null)
|
||||
if [ -z "$gitDir" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
local headFile="$gitDir/HEAD"
|
||||
[ -f "$headFile" ] || return 0
|
||||
|
||||
local headContent
|
||||
headContent=$(< "$headFile")
|
||||
if [[ "$headContent" =~ ^ref:\ refs/heads/(.+)$ ]]
|
||||
headContent=$(< "$gitDir/HEAD")
|
||||
if [[ "$headContent" == "ref: refs/heads/"* ]]
|
||||
then
|
||||
echo " (${BASH_REMATCH[1]})"
|
||||
echo " (${headContent:16})"
|
||||
else
|
||||
echo " (HEAD detached at ${headContent:0:7})"
|
||||
echo " (HEAD detached at ${headContent:0:7})"
|
||||
fi
|
||||
}
|
||||
|
||||
@ -42,18 +33,18 @@ fi
|
||||
|
||||
if test -f ~/.config/git/git-prompt.sh
|
||||
then
|
||||
if getGitStatusSetting
|
||||
if [[ $(getGitStatusSetting) == true ]]
|
||||
then
|
||||
. ~/.config/git/git-prompt.sh
|
||||
fi
|
||||
else
|
||||
# Taken parts from https://github.com/git-for-windows/build-extra/blob/main/git-extra/git-prompt.sh
|
||||
PS1='\[\033]0;${TITLEPREFIX:+$TITLEPREFIX:}${PWD//[^[:ascii:]]/?}\007\]' # set window title to TITLEPREFIX (if set) and current working directory
|
||||
# PS1="$PS1"'\n' # new line (disabled)
|
||||
PS1="$PS1"'\[\033[32m\]' # change to green and bold
|
||||
PS1='\[\033]0;$MSYSTEM:${PWD//[^[:ascii:]]/?}\007\]' # set window title
|
||||
# PS1="$PS1"'\n' # new line
|
||||
PS1="$PS1"'\[\033[32m\]' # change to green
|
||||
PS1="$PS1"'\u@\h ' # user@host<space>
|
||||
PS1="$PS1${MSYSTEM:+\[\033[35m\]$MSYSTEM }" # show MSYSTEM in purple (if set)
|
||||
PS1="$PS1"'\[\033[1;33m\]' # change to dark yellow in bold
|
||||
# PS1="$PS1"'\[\033[35m\]' # change to purple
|
||||
# PS1="$PS1"'$MSYSTEM ' # show MSYSTEM
|
||||
PS1="$PS1"'\[\033[33m\]' # change to brownish yellow
|
||||
PS1="$PS1"'\w' # current working directory
|
||||
if test -z "$WINELOADERNOEXEC"
|
||||
then
|
||||
@ -64,7 +55,7 @@ else
|
||||
if test -f "$COMPLETION_PATH/git-prompt.sh"
|
||||
then
|
||||
. "$COMPLETION_PATH/git-completion.bash"
|
||||
if getGitStatusSetting
|
||||
if [[ $(getGitStatusSetting) == true ]]
|
||||
then
|
||||
. "$COMPLETION_PATH/git-prompt.sh"
|
||||
PS1="$PS1"'\[\033[36m\]' # change color to cyan
|
||||
@ -75,22 +66,9 @@ else
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
PS1="$PS1"'\[\033[0m\]' # reset color
|
||||
PS1="$PS1"'\[\033[0m\]' # change color
|
||||
PS1="$PS1"'\n' # new line
|
||||
PS1="$PS1"'\[\033[30;1m\]' # change color to grey in bold
|
||||
PS1="$PS1"'λ ' # prompt: Cmder uses λ
|
||||
PS1="$PS1"'\[\033[0m\]' # reset color
|
||||
PS1="$PS1"'λ ' # prompt: always λ
|
||||
fi
|
||||
|
||||
MSYS2_PS1="$PS1" # for detection by MSYS2 SDK's bash.basrc
|
||||
|
||||
# Evaluate all user-specific Bash completion scripts (if any)
|
||||
if test -z "$WINELOADERNOEXEC"
|
||||
then
|
||||
for c in "$HOME"/bash_completion.d/*.bash
|
||||
do
|
||||
# Handle absence of any scripts (or the folder) gracefully
|
||||
test ! -f "$c" ||
|
||||
. "$c"
|
||||
done
|
||||
fi
|
||||
|
114
vendor/init.bat
vendored
114
vendor/init.bat
vendored
@ -166,24 +166,9 @@ if "%PROCESSOR_ARCHITECTURE%"=="x86" (
|
||||
set CMDER_CLINK=0
|
||||
)
|
||||
|
||||
if defined CMDER_USER_CONFIG (
|
||||
if exist "%CMDER_ROOT%\config\user_init.cmd" (
|
||||
call "%CMDER_ROOT%\config\user_init.cmd"
|
||||
exit /b
|
||||
) else if exist "%CMDER_USER_CONFIG%\config\user_init.cmd" (
|
||||
call "%CMDER_USER_CONFIG%\config\user_init.cmd"
|
||||
exit /b
|
||||
)
|
||||
) else if exist "%CMDER_ROOT%\config\user_init.cmd" (
|
||||
call "%CMDER_ROOT%\config\user_init.cmd"
|
||||
exit /b
|
||||
)
|
||||
|
||||
if "%CMDER_CLINK%" == "1" (
|
||||
REM TODO: Detect if clink is already injected, if so goto :CLINK_FINISH
|
||||
goto :INJECT_CLINK
|
||||
) else if "%CMDER_CLINK%" == "2" (
|
||||
goto :CLINK_FINISH
|
||||
)
|
||||
|
||||
goto :SKIP_CLINK
|
||||
@ -220,7 +205,6 @@ goto :SKIP_CLINK
|
||||
)
|
||||
|
||||
"%CMDER_ROOT%\vendor\clink\clink_%clink_architecture%.exe" inject --quiet --profile "%CMDER_CONFIG_DIR%" --scripts "%CMDER_ROOT%\vendor"
|
||||
set CMDER_CLINK=2
|
||||
|
||||
:: Check if a fatal error occurred when trying to inject Clink
|
||||
if errorlevel 2 (
|
||||
@ -315,7 +299,7 @@ if exist "%CMDER_ROOT%\vendor\git-for-windows" (
|
||||
)
|
||||
|
||||
:SPECIFIED_GIT
|
||||
%print_debug% init.bat "Using specified GIT_INSTALL_ROOT=%GIT_INSTALL_ROOT%...."
|
||||
%print_debug% init.bat "Using /GIT_INSTALL_ROOT..."
|
||||
goto :CONFIGURE_GIT
|
||||
|
||||
:FOUND_GIT
|
||||
@ -324,13 +308,8 @@ goto :CONFIGURE_GIT
|
||||
|
||||
:CONFIGURE_GIT
|
||||
%print_debug% init.bat "Using Git from '%GIT_INSTALL_ROOT%..."
|
||||
|
||||
:: Add git to the path
|
||||
%print_debug% init.bat "START - git.exe(prepend): Env Var - PATH=%path%"
|
||||
if exist "%GIT_INSTALL_ROOT%\cmd\git.exe" (
|
||||
set "path=%GIT_INSTALL_ROOT%\cmd;%path%"
|
||||
)
|
||||
%print_debug% init.bat "END - git.exe(prepend): Env Var - PATH=%path%"
|
||||
if exist "%GIT_INSTALL_ROOT%\cmd\git.exe" %lib_path% enhance_path "%GIT_INSTALL_ROOT%\cmd" ""
|
||||
|
||||
:: Add the unix commands at the end to not shadow windows commands like `more` and `find`
|
||||
if %nix_tools% equ 1 (
|
||||
@ -341,30 +320,16 @@ if %nix_tools% equ 1 (
|
||||
set "path_position="
|
||||
)
|
||||
|
||||
%print_debug% init.bat "START - nix_tools(%path_position%): Env Var - PATH=%path%"
|
||||
if %nix_tools% geq 1 (
|
||||
if exist "%GIT_INSTALL_ROOT%\mingw32" (
|
||||
if "%path_position%" == "append" (
|
||||
set "path=%path%;%GIT_INSTALL_ROOT%\mingw32\bin"
|
||||
) else (
|
||||
set "path=%GIT_INSTALL_ROOT%\mingw32\bin;%path%"
|
||||
)
|
||||
%lib_path% enhance_path "%GIT_INSTALL_ROOT%\mingw32\bin" %path_position%
|
||||
) else if exist "%GIT_INSTALL_ROOT%\mingw64" (
|
||||
if "%path_position%" == "append" (
|
||||
set "path=%path%;%GIT_INSTALL_ROOT%\mingw64\bin"
|
||||
) else (
|
||||
set "path=%GIT_INSTALL_ROOT%\mingw64\bin;%path%"
|
||||
)
|
||||
%lib_path% enhance_path "%GIT_INSTALL_ROOT%\mingw64\bin" %path_position%
|
||||
)
|
||||
if exist "%GIT_INSTALL_ROOT%\usr\bin" (
|
||||
if "%path_position%" == "append" (
|
||||
set "path=%path%;%GIT_INSTALL_ROOT%\usr\bin"
|
||||
) else (
|
||||
set "path=%GIT_INSTALL_ROOT%\usr\bin;%path%"
|
||||
)
|
||||
%lib_path% enhance_path "%GIT_INSTALL_ROOT%\usr\bin" %path_position%
|
||||
)
|
||||
)
|
||||
%print_debug% init.bat "END - nix_tools(%path_position%): Env Var - PATH=%path%"
|
||||
|
||||
:SET_ENV
|
||||
|
||||
@ -397,7 +362,8 @@ if defined git_locale (
|
||||
)
|
||||
endlocal && set LANG=%LANG%
|
||||
|
||||
%print_debug% init.bat "Found Git in: 'GIT_INSTALL_ROOT=%GIT_INSTALL_ROOT%'"
|
||||
%print_debug% init.bat "Env Var - GIT_INSTALL_ROOT=%GIT_INSTALL_ROOT%"
|
||||
%print_debug% init.bat "Found Git in: '%GIT_INSTALL_ROOT%'"
|
||||
goto :PATH_ENHANCE
|
||||
|
||||
:NO_GIT
|
||||
@ -405,32 +371,14 @@ goto :PATH_ENHANCE
|
||||
endlocal
|
||||
|
||||
:PATH_ENHANCE
|
||||
%print_debug% init.bat "START - vendor/bin(prepend): Env Var - PATH=%path%"
|
||||
set "path=%CMDER_ROOT%\vendor\bin;%path%"
|
||||
%print_debug% init.bat "END - vendor/bin(prepend): Env Var - PATH=%path%"
|
||||
%lib_path% enhance_path "%CMDER_ROOT%\vendor\bin"
|
||||
|
||||
:USER_CONFIG_START
|
||||
%print_debug% init.bat "START - bin(prepend): Env Var - PATH=%path%"
|
||||
if %max_depth% gtr 1 (
|
||||
%lib_path% enhance_path_recursive "%CMDER_ROOT%\bin" 0 %max_depth%
|
||||
) else (
|
||||
set "path=%CMDER_ROOT%\bin;%path%"
|
||||
)
|
||||
%print_debug% init.bat "END - bin(prepend): Env Var - PATH=%path%"
|
||||
|
||||
if defined CMDER_USER_BIN if defined CMDER_USER_ROOT (
|
||||
%print_debug% init.bat "START - user_bin(prepend): Env Var - PATH=%path%"
|
||||
if %max_depth% gtr 1 (
|
||||
%lib_path% enhance_path_recursive "%CMDER_ROOT%\bin" 0 %max_depth%
|
||||
if defined CMDER_USER_BIN (
|
||||
%lib_path% enhance_path_recursive "%CMDER_USER_BIN%" 0 %max_depth%
|
||||
) else (
|
||||
set "path=%CMDER_USER_ROOT%\bin;%path%"
|
||||
)
|
||||
%print_debug% init.bat "END - user_bin(prepend): Env Var - PATH=!path!"
|
||||
)
|
||||
|
||||
%print_debug% init.bat "START - cmder_root(append): Env Var - PATH=%path%"
|
||||
set "path=%path%;%CMDER_ROOT%"
|
||||
%print_debug% init.bat "END - cmder_root(append): Env Var - PATH=%path%"
|
||||
%lib_path% enhance_path "%CMDER_ROOT%" append
|
||||
|
||||
:: Drop *.bat and *.cmd files into "%CMDER_ROOT%\config\profile.d"
|
||||
:: to run them at startup.
|
||||
@ -478,7 +426,7 @@ if "%CMDER_ALIASES%" == "1" (
|
||||
)
|
||||
|
||||
:: Add aliases to the environment
|
||||
type "%user_aliases%" | %WINDIR%\System32\findstr /b /l /i "history=cat " >nul
|
||||
type "%user_aliases%" | findstr /b /l /i "history=cat " >nul
|
||||
if "%ERRORLEVEL%" == "0" (
|
||||
echo Migrating alias 'history' to new Clink 1.x.x...
|
||||
call "%CMDER_ROOT%\vendor\bin\alias.cmd" /d history
|
||||
@ -539,40 +487,12 @@ if "%CMDER_ALIASES%" == "1" if exist "%CMDER_ROOT%\bin\alias.bat" if exist "%CMD
|
||||
|
||||
set initialConfig=
|
||||
|
||||
if not exist "%CMDER_CONFIG_DIR%\user_init.cmd" (
|
||||
powershell -executionpolicy bypass -f "%cmder_root%\vendor\bin\create-cmdercfg.ps1" -shell cmd -outfile "%CMDER_CONFIG_DIR%\user_init.cmd"
|
||||
|
||||
if not exist "%CMDER_ROOT%\config\user_init.cmd" (
|
||||
%print_error% "Failed to generate Cmder config"
|
||||
)
|
||||
)
|
||||
|
||||
:CMDER_CONFIGURED
|
||||
if not defined CMDER_CONFIGURED set CMDER_CONFIGURED=1
|
||||
set CMDER_INIT_END=%time%
|
||||
if not defined CMDER_CONFIGURED set CMDER_CONFIGURED=1
|
||||
|
||||
if "%time_init%" == "1" if "%CMDER_INIT_END%" neq "" if "%CMDER_INIT_START%" neq "" (
|
||||
call "%cmder_root%\vendor\bin\timer.cmd" "%CMDER_INIT_START%" "%CMDER_INIT_END%"
|
||||
)
|
||||
|
||||
:CLEANUP
|
||||
set architecture_bits=
|
||||
set CMDER_ALIASES=
|
||||
set CMDER_INIT_END=
|
||||
set CMDER_INIT_START=
|
||||
set CMDER_USER_FLAGS=
|
||||
set CMDER_CLINK=
|
||||
set debug_output=
|
||||
set fast_init=
|
||||
set max_depth=
|
||||
set nix_tools=
|
||||
set path_position=
|
||||
set print_debug=
|
||||
set print_error=
|
||||
set print_verbose=
|
||||
set print_warning=
|
||||
set time_init=
|
||||
set verbose_output=
|
||||
set user_aliases=
|
||||
set CMDER_INIT_END=%time%
|
||||
|
||||
if %time_init% gtr 0 (
|
||||
"%cmder_root%\vendor\bin\timer.cmd" "%CMDER_INIT_START%" "%CMDER_INIT_END%"
|
||||
)
|
||||
exit /b
|
||||
|
64
vendor/lib/lib_base.cmd
vendored
64
vendor/lib/lib_base.cmd
vendored
@ -10,8 +10,9 @@ if "%~1" == "/h" (
|
||||
|
||||
exit /b
|
||||
|
||||
:help
|
||||
:::===============================================================================
|
||||
:::help - shows all sub routines in a .bat/.cmd file with documentation
|
||||
:::show_subs - shows all sub routines in a .bat/.cmd file with documentation
|
||||
:::.
|
||||
:::include:
|
||||
:::.
|
||||
@ -19,15 +20,16 @@ exit /b
|
||||
:::.
|
||||
:::usage:
|
||||
:::.
|
||||
::: %lib_base% help "file"
|
||||
::: %lib_base% show_subs "file"
|
||||
:::.
|
||||
:::options:
|
||||
:::.
|
||||
::: file <in> full path to file containing lib_routines to display
|
||||
:::.
|
||||
:::-------------------------------------------------------------------------------
|
||||
for /f "tokens=* delims=:" %%a in ('type "%~1" ^| %WINDIR%\System32\findstr /i /r "^:::"') do (
|
||||
rem echo a="%%a"
|
||||
|
||||
:help
|
||||
for /f "tokens=* delims=:" %%a in ('%WINDIR%\System32\findstr /i /r "^:::" "%~1"') do (
|
||||
if "%%a"=="." (
|
||||
echo.
|
||||
) else if /i "%%a" == "usage" (
|
||||
@ -42,13 +44,9 @@ exit /b
|
||||
pause
|
||||
exit /b
|
||||
|
||||
:cmder_shell
|
||||
:::===============================================================================
|
||||
:::cmder_shell - Initializes the Cmder shell environment variables
|
||||
:::.
|
||||
:::description:
|
||||
:::.
|
||||
::: This routine sets up the Cmder shell environment by detecting the
|
||||
::: command shell and initializing related variables.
|
||||
:::show_subs - shows all sub routines in a .bat/.cmd file with documentation
|
||||
:::.
|
||||
:::include:
|
||||
:::.
|
||||
@ -57,30 +55,15 @@ exit /b
|
||||
:::usage:
|
||||
:::.
|
||||
::: %lib_base% cmder_shell
|
||||
:::.
|
||||
:::options:
|
||||
:::.
|
||||
::: file <in> full path to file containing lib_routines to display
|
||||
:::.
|
||||
:::-------------------------------------------------------------------------------
|
||||
|
||||
:cmder_shell
|
||||
call :detect_comspec %ComSpec%
|
||||
exit /b
|
||||
|
||||
:::===============================================================================
|
||||
:::detect_comspec - Detects the command shell being used:::
|
||||
:::.
|
||||
:::description:
|
||||
:::.
|
||||
::: This function sets the CMDER_SHELL variable to the name of the
|
||||
::: detected command shell. It also initializes the CMDER_CLINK and
|
||||
::: CMDER_ALIASES variables if they are not already defined.
|
||||
:::.
|
||||
:::include:
|
||||
:::.
|
||||
::: call "lib_base.cmd"
|
||||
:::.
|
||||
:::usage:
|
||||
:::.
|
||||
::: %lib_base% detect_comspec %ComSpec%
|
||||
:::-------------------------------------------------------------------------------
|
||||
|
||||
:detect_comspec
|
||||
set CMDER_SHELL=%~n1
|
||||
if not defined CMDER_CLINK (
|
||||
@ -91,27 +74,6 @@ exit /b
|
||||
)
|
||||
exit /b
|
||||
|
||||
:::===============================================================================
|
||||
:::update_legacy_aliases - Updates the legacy alias definitions in the user_aliases file
|
||||
:::.
|
||||
:::description:
|
||||
:::.
|
||||
::: This function checks if the user_aliases file contains the marker
|
||||
::: ";= Add aliases below here". If the marker is not found, it creates
|
||||
::: an initial user_aliases store by copying the default user_aliases file
|
||||
::: from the CMDER_ROOT directory. If the CMDER_USER_CONFIG environment
|
||||
::: variable is defined, it creates a backup of the existing user_aliases
|
||||
::: file before copying the default file.
|
||||
:::.
|
||||
:::include:
|
||||
:::.
|
||||
::: call "lib_base.cmd"
|
||||
:::.
|
||||
:::usage:
|
||||
:::.
|
||||
::: %lib_base% update_legacy_aliases
|
||||
:::-------------------------------------------------------------------------------
|
||||
|
||||
:update_legacy_aliases
|
||||
type "%user_aliases%" | %WINDIR%\System32\findstr /i ";= Add aliases below here" >nul
|
||||
if "%errorlevel%" == "1" (
|
||||
|
31
vendor/lib/lib_git.cmd
vendored
31
vendor/lib/lib_git.cmd
vendored
@ -12,6 +12,7 @@ if "%~1" == "/h" (
|
||||
|
||||
exit /b
|
||||
|
||||
:read_version
|
||||
:::===============================================================================
|
||||
:::read_version - Get the git.exe version
|
||||
:::.
|
||||
@ -33,7 +34,6 @@ exit /b
|
||||
::: GIT_VERSION_[GIT SCOPE] <out> Env variable containing Git semantic version string
|
||||
:::-------------------------------------------------------------------------------
|
||||
|
||||
:read_version
|
||||
:: clear the variables
|
||||
set GIT_VERSION_%~1=
|
||||
|
||||
@ -55,7 +55,6 @@ exit /b
|
||||
set "GIT_VERSION=%%C"
|
||||
) else (
|
||||
echo "'git --version' returned an improper version string!"
|
||||
%print_debug% :read_version "returned string: '%%A %%B %%C' by executable path: %git_executable%"
|
||||
pause
|
||||
exit /b
|
||||
)
|
||||
@ -64,6 +63,7 @@ exit /b
|
||||
|
||||
exit /b
|
||||
|
||||
:parse_version
|
||||
:::===============================================================================
|
||||
:::parse_version - Parse semantic version string 'x.x.x.x' and return the pieces
|
||||
:::.
|
||||
@ -88,7 +88,6 @@ exit /b
|
||||
::: [SCOPE]_BUILD <out> Scoped Build version.
|
||||
:::-------------------------------------------------------------------------------
|
||||
|
||||
:parse_version
|
||||
:: process a `x.x.x.xxxx.x` formatted string
|
||||
%print_debug% :parse_version "ARGV[1]=%~1, ARGV[2]=%~2"
|
||||
|
||||
@ -111,8 +110,9 @@ exit /b
|
||||
|
||||
:endlocal_set_git_version
|
||||
|
||||
:validate_version
|
||||
:::===============================================================================
|
||||
:::validate_version - Validate semantic version string 'x.x.x.x'
|
||||
:::validate_version - Validate semantic version string 'x.x.x.x'.
|
||||
:::.
|
||||
:::include:
|
||||
:::.
|
||||
@ -128,7 +128,6 @@ exit /b
|
||||
::: [VERSION] <in> Semantic version String. Ex: 1.2.3.4
|
||||
:::-------------------------------------------------------------------------------
|
||||
|
||||
:validate_version
|
||||
:: now parse the version information into the corresponding variables
|
||||
%print_debug% :validate_version "ARGV[1]=%~1, ARGV[2]=%~2"
|
||||
|
||||
@ -143,8 +142,9 @@ exit /b
|
||||
)
|
||||
exit /b
|
||||
|
||||
:compare_versions
|
||||
:::===============================================================================
|
||||
:::compare_version - Compare semantic versions and return latest version
|
||||
:::compare_version - Compare semantic versions return latest version.
|
||||
:::.
|
||||
:::include:
|
||||
:::.
|
||||
@ -160,7 +160,6 @@ exit /b
|
||||
::: [SCOPE2] <in> Example: VENDOR
|
||||
:::-------------------------------------------------------------------------------
|
||||
|
||||
:compare_versions
|
||||
:: checks all major, minor, patch and build variables for the given arguments.
|
||||
:: whichever binary that has the most recent version will be used based on the return code.
|
||||
|
||||
@ -185,12 +184,7 @@ exit /b
|
||||
endlocal & exit /b 0
|
||||
|
||||
:::===============================================================================
|
||||
:::is_git_shim - Check if the directory has a git.shim file
|
||||
:::.
|
||||
:::description:
|
||||
:::.
|
||||
::: Shim is a small helper program for Scoop that calls the executable configured in git.shim file
|
||||
::: See: github.com/ScoopInstaller/Shim and github.com/cmderdev/cmder/pull/1905
|
||||
:::is_git_shim
|
||||
:::.
|
||||
:::include:
|
||||
:::.
|
||||
@ -207,7 +201,7 @@ exit /b
|
||||
|
||||
:is_git_shim
|
||||
pushd "%~1"
|
||||
:: check if there is a shim file - if yes, read the actual executable path
|
||||
:: check if there's shim - and if yes follow the path
|
||||
setlocal enabledelayedexpansion
|
||||
if exist git.shim (
|
||||
for /F "tokens=2 delims== " %%I in (git.shim) do (
|
||||
@ -224,7 +218,7 @@ exit /b
|
||||
exit /b
|
||||
|
||||
:::===============================================================================
|
||||
:::compare_git_versions - Compare the user git version against the vendored version
|
||||
:::compare_git_versions
|
||||
:::.
|
||||
:::include:
|
||||
:::.
|
||||
@ -258,7 +252,7 @@ exit /b
|
||||
:: if the user provided git executable is not found
|
||||
IF ERRORLEVEL -255 IF NOT ERRORLEVEL -254 (
|
||||
:: if not exist "%git_executable%" (
|
||||
%print_debug% ":compare_git_versions" "No git at '%git_executable%' found."
|
||||
%print_debug% ":compare_git_versions" "No git at "%git_executable%" found."
|
||||
set test_dir=
|
||||
)
|
||||
)
|
||||
@ -267,7 +261,7 @@ exit /b
|
||||
exit /b
|
||||
|
||||
:::===============================================================================
|
||||
:::get_user_git_version - Get the version information for the user provided git binary
|
||||
:::get_user_git_version - get the version information for the user provided git binary
|
||||
:::.
|
||||
:::include:
|
||||
:::.
|
||||
@ -283,4 +277,5 @@ exit /b
|
||||
%lib_git% read_version USER "%test_dir%" 2>nul
|
||||
%print_debug% ":get_user_git_version" "get_user_git_version GIT_VERSION_USER: %GIT_VERSION_USER%"
|
||||
%lib_git% validate_version USER %GIT_VERSION_USER%
|
||||
exit /b
|
||||
exit /b
|
||||
|
||||
|
68
vendor/lib/lib_path.cmd
vendored
68
vendor/lib/lib_path.cmd
vendored
@ -1,5 +1,6 @@
|
||||
@echo off
|
||||
|
||||
|
||||
call "%~dp0lib_base.cmd"
|
||||
call "%%~dp0lib_console"
|
||||
set lib_path=call "%~dp0lib_path.cmd"
|
||||
@ -10,13 +11,6 @@ if "%~1" == "/h" (
|
||||
call :%*
|
||||
)
|
||||
|
||||
setlocal enabledelayedexpansion
|
||||
if not defined find_pathext (
|
||||
set "find_pathext=!PATHEXT:;= !"
|
||||
set "find_pathext=!find_pathext:.=\.!"
|
||||
)
|
||||
endlocal & set "find_pathext=%find_pathext%"
|
||||
|
||||
exit /b
|
||||
|
||||
:enhance_path
|
||||
@ -38,12 +32,13 @@ exit /b
|
||||
:::options:
|
||||
:::
|
||||
::: append <in> Append to the path env variable rather than pre-pend.
|
||||
:::
|
||||
::B
|
||||
:::
|
||||
:::output:
|
||||
:::
|
||||
::: path <out> Sets the path env variable if required.
|
||||
:::-------------------------------------------------------------------------------
|
||||
|
||||
if "%~1" neq "" (
|
||||
set "add_path=%~1"
|
||||
) else (
|
||||
@ -57,8 +52,7 @@ exit /b
|
||||
set "position="
|
||||
)
|
||||
|
||||
dir "%add_path%" 2>NUL | findstr -i -e "%find_pathext%" >NUL
|
||||
|
||||
dir "%add_path%" | findstr -i "\.COM \.EXE \.BAT \.CMD \.PS1 \.VBS" >NUL
|
||||
if "%ERRORLEVEL%" == "0" (
|
||||
set "add_to_path=%add_path%"
|
||||
) else (
|
||||
@ -87,20 +81,20 @@ exit /b
|
||||
echo "!path!"|!WINDIR!\System32\findstr >nul /I /R /C:";!find_query!;"
|
||||
call :set_found
|
||||
)
|
||||
%print_debug% :enhance_path "Env Var INSIDE PATH !find_query! - found=!found!"
|
||||
%print_debug% :enhance_path "Env Var INSIDE PATH !find_query! - found=!found!"
|
||||
|
||||
if /i "!position!" == "append" (
|
||||
if "!found!" == "0" (
|
||||
echo "!path!"|!WINDIR!\System32\findstr >nul /I /R /C:";!find_query!\"$"
|
||||
call :set_found
|
||||
)
|
||||
%print_debug% :enhance_path "Env Var END PATH !find_query! - found=!found!"
|
||||
%print_debug% :enhance_path "Env Var END PATH !find_query! - found=!found!"
|
||||
) else (
|
||||
if "!found!" == "0" (
|
||||
echo "!path!"|!WINDIR!\System32\findstr >nul /I /R /C:"^\"!find_query!;"
|
||||
call :set_found
|
||||
)
|
||||
%print_debug% :enhance_path "Env Var BEGIN PATH !find_query! - found=!found!"
|
||||
%print_debug% :enhance_path "Env Var BEGIN PATH !find_query! - found=!found!"
|
||||
)
|
||||
endlocal & set found=%found%
|
||||
|
||||
@ -135,12 +129,13 @@ exit /b
|
||||
exit /b
|
||||
|
||||
:changed
|
||||
%print_debug% :enhance_path "END Env Var - PATH=%path%"
|
||||
%print_debug% :enhance_path "Env Var %find_query% - found=%found%"
|
||||
%print_debug% :enhance_path "END Env Var - PATH=%path%"
|
||||
%print_debug% :enhance_path "Env Var %find_query% - found=%found%"
|
||||
exit /b
|
||||
|
||||
exit /b
|
||||
|
||||
|
||||
:set_found
|
||||
if "%ERRORLEVEL%" == "0" (
|
||||
set found=1
|
||||
@ -149,12 +144,8 @@ exit /b
|
||||
exit /b
|
||||
|
||||
:enhance_path_recursive
|
||||
call :set_path_recursive "%~1" "%~2" "%~3"
|
||||
exit /b
|
||||
|
||||
:set_path_recursive
|
||||
:::===============================================================================
|
||||
:::set_path_recursive - Add a directory and subs to the path env variable if
|
||||
:::enhance_path_recursive - Add a directory and subs to the path env variable if
|
||||
::: required.
|
||||
:::.
|
||||
:::include:
|
||||
@ -163,7 +154,7 @@ exit /b
|
||||
:::.
|
||||
:::usage:
|
||||
:::.
|
||||
::: call "%~DP0lib_path" set_path_recursive "[dir_path]" [max_depth] [append]
|
||||
::: call "%~DP0lib_path" enhance_path_recursive "[dir_path]" [max_depth] [append]
|
||||
:::.
|
||||
:::required:
|
||||
:::.
|
||||
@ -195,7 +186,7 @@ exit /b
|
||||
set "position="
|
||||
)
|
||||
|
||||
dir "%add_path%" 2>NUL | findstr -i -e "%find_pathext%" >NUL
|
||||
dir "%add_path%" 2>NUL | findstr -i "\.COM \.EXE \.BAT \.CMD \.PS1 \.VBS" >NUL
|
||||
|
||||
if "%ERRORLEVEL%" == "0" (
|
||||
set "add_to_path=%add_path%"
|
||||
@ -205,11 +196,7 @@ exit /b
|
||||
|
||||
if "%fast_init%" == "1" (
|
||||
if "%add_to_path%" neq "" (
|
||||
if "%position%" == "append" (
|
||||
set "path=%path%;%add_to_path%"
|
||||
) else (
|
||||
set "path=%add_to_path%;%path%"
|
||||
)
|
||||
call :enhance_path "%add_to_path%" %position%
|
||||
)
|
||||
)
|
||||
|
||||
@ -218,19 +205,15 @@ exit /b
|
||||
exit /b
|
||||
)
|
||||
|
||||
%print_debug% :set_path_recursive "Env Var - add_path=%add_to_path%"
|
||||
%print_debug% :set_path_recursive "Env Var - position=%position%"
|
||||
%print_debug% :set_path_recursive "Env Var - depth=%depth%"
|
||||
%print_debug% :set_path_recursive "Env Var - max_depth=%max_depth%"
|
||||
%print_debug% :enhance_path_recursive "Env Var - add_path=%add_to_path%"
|
||||
%print_debug% :enhance_path_recursive "Env Var - position=%position%"
|
||||
%print_debug% :enhance_path_recursive "Env Var - depth=%depth%"
|
||||
%print_debug% :enhance_path_recursive "Env Var - max_depth=%max_depth%"
|
||||
|
||||
if %max_depth% gtr %depth% (
|
||||
if "%add_to_path%" neq "" (
|
||||
%print_debug% :set_path_recursive "Adding parent directory - '%add_to_path%'"
|
||||
if "%position%" == "append" (
|
||||
set "path=%path%;%add_to_path%"
|
||||
) else (
|
||||
set "path=%add_to_path%;%path%"
|
||||
)
|
||||
%print_debug% :enhance_path_recursive "Adding parent directory - '%add_to_path%'"
|
||||
call :enhance_path "%add_to_path%" %position%
|
||||
)
|
||||
call :set_depth
|
||||
call :loop_depth
|
||||
@ -240,7 +223,7 @@ exit /b
|
||||
|
||||
exit /b
|
||||
|
||||
:set_depth
|
||||
: set_depth
|
||||
set /a "depth=%depth%+1"
|
||||
exit /b
|
||||
|
||||
@ -250,9 +233,10 @@ exit /b
|
||||
)
|
||||
|
||||
for /d %%i in ("%add_path%\*") do (
|
||||
%print_debug% :set_path_recursive "Env Var BEFORE - depth=%depth%"
|
||||
%print_debug% :set_path_recursive "Found Subdirectory - '%%~fi'"
|
||||
call :set_path_recursive "%%~fi" %depth% %max_depth% %position%
|
||||
%print_debug% :set_path_recursive "Env Var AFTER- depth=%depth%"
|
||||
%print_debug% :enhance_path_recursive "Env Var BEFORE - depth=%depth%"
|
||||
%print_debug% :enhance_path_recursive "Found Subdirectory - '%%~fi'"
|
||||
call :enhance_path_recursive "%%~fi" %depth% %max_depth% %position%
|
||||
%print_debug% :enhance_path_recursive "Env Var AFTER- depth=%depth%"
|
||||
)
|
||||
exit /b
|
||||
|
||||
|
19
vendor/lib/lib_profile.cmd
vendored
19
vendor/lib/lib_profile.cmd
vendored
@ -12,26 +12,26 @@ if "%~1" == "/h" (
|
||||
|
||||
exit /b
|
||||
|
||||
:run_profile_d
|
||||
:::===============================================================================
|
||||
:::run_profile_d - Run all scripts in the passed directory path
|
||||
:::.
|
||||
:::run_profile_d - Run all scripts in the passed dir path
|
||||
:::
|
||||
:::include:
|
||||
:::.
|
||||
:::
|
||||
::: call "lib_profile.cmd"
|
||||
:::.
|
||||
:::
|
||||
:::usage:
|
||||
:::.
|
||||
:::
|
||||
::: %lib_profile% "[dir_path]"
|
||||
:::.
|
||||
:::
|
||||
:::required:
|
||||
:::.
|
||||
:::
|
||||
::: [dir_path] <in> Fully qualified directory path containing init *.cmd|*.bat.
|
||||
::: Example: "c:\bin"
|
||||
:::.
|
||||
:::
|
||||
::: path <out> Sets the path env variable if required.
|
||||
:::-------------------------------------------------------------------------------
|
||||
|
||||
:run_profile_d
|
||||
if not exist "%~1" (
|
||||
mkdir "%~1"
|
||||
)
|
||||
@ -43,3 +43,4 @@ exit /b
|
||||
)
|
||||
popd
|
||||
exit /b
|
||||
|
||||
|
2
vendor/profile.ps1
vendored
2
vendor/profile.ps1
vendored
@ -86,7 +86,7 @@ if ($null -ne $ENV:GIT_INSTALL_ROOT) {
|
||||
}
|
||||
|
||||
if (Get-Command -Name "vim" -ErrorAction SilentlyContinue) {
|
||||
New-Alias -name "vi" -value vim -errorAction SilentlyContinue
|
||||
New-Alias -name "vi" -value vim
|
||||
}
|
||||
|
||||
if (Get-Module PSReadline -ErrorAction "SilentlyContinue") {
|
||||
|
29
vendor/psmodules/Cmder.ps1
vendored
29
vendor/psmodules/Cmder.ps1
vendored
@ -18,8 +18,7 @@ function readVersion($gitPath) {
|
||||
}
|
||||
|
||||
function isGitShim($gitPath) {
|
||||
# check if there is a shim file - if yes, read the actual executable path
|
||||
# See: github.com/ScoopInstaller/Shim
|
||||
# check if there's shim - and if yes follow the path
|
||||
|
||||
if (Test-Path "${gitPath}\git.shim") {
|
||||
$shim = (get-content "${gitPath}\git.shim")
|
||||
@ -177,29 +176,3 @@ function getGitStatusSetting() {
|
||||
|
||||
return $true
|
||||
}
|
||||
|
||||
function yOrn( $question ) {
|
||||
Do {
|
||||
$Answer = Read-Host -Prompt "`n${question}? (y/n) "
|
||||
}
|
||||
Until ($Answer -eq 'y' -or $Answer -eq 'n' -or $Answer -eq 'yes' -or $Answer -eq 'no')
|
||||
|
||||
return $Answer
|
||||
}
|
||||
|
||||
function templateExpand($template_filename, $outfile) {
|
||||
$template = Get-Content "$template_filename" -Raw
|
||||
|
||||
$expanded = Invoke-Expression "@`"`r`n$template`r`n`"@"
|
||||
|
||||
$overwrite = 'y'
|
||||
if ((test-path "$outfile")) {
|
||||
$overwrite = yOrn "'$outfile' already exists do you want to overwrite it"
|
||||
}
|
||||
|
||||
if ($overwrite -match 'y') {
|
||||
$expanded | out-file -ErrorAction silentlycontinue -encoding ascii "$outfile"
|
||||
} else {
|
||||
write-host "Skipping Cmder '$shell' config generation at user request!"
|
||||
}
|
||||
}
|
||||
|
17
vendor/sources.json
vendored
17
vendor/sources.json
vendored
@ -1,18 +1,13 @@
|
||||
[
|
||||
{
|
||||
"name": "windows-terminal",
|
||||
"version": "1.20.11271.0",
|
||||
"url": "https://github.com/microsoft/terminal/releases/download/v1.20.11271.0/Microsoft.WindowsTerminal_1.20.11271.0_x64.zip"
|
||||
},
|
||||
{
|
||||
"name": "git-for-windows",
|
||||
"version": "2.49.0.windows.1",
|
||||
"url": "https://github.com/git-for-windows/git/releases/download/v2.49.0.windows.1/PortableGit-2.49.0-64-bit.7z.exe"
|
||||
"version": "2.41.0.windows.3",
|
||||
"url": "https://github.com/git-for-windows/git/releases/download/v2.41.0.windows.3/PortableGit-2.41.0.3-64-bit.7z.exe"
|
||||
},
|
||||
{
|
||||
"name": "clink",
|
||||
"version": "1.7.14",
|
||||
"url": "https://github.com/chrisant996/clink/releases/download/v1.7.14/clink.1.7.14.843933.zip"
|
||||
"version": "1.5.1",
|
||||
"url": "https://github.com/chrisant996/clink/releases/download/v1.5.1/clink.1.5.1.1e9e51.zip"
|
||||
},
|
||||
{
|
||||
"name": "conemu-maximus5",
|
||||
@ -21,7 +16,7 @@
|
||||
},
|
||||
{
|
||||
"name": "clink-completions",
|
||||
"version": "0.6.2",
|
||||
"url": "https://github.com/vladimir-kotikov/clink-completions/archive/v0.6.2.zip"
|
||||
"version": "0.4.10",
|
||||
"url": "https://github.com/vladimir-kotikov/clink-completions/archive/v0.4.10.zip"
|
||||
}
|
||||
]
|
||||
|
51
vendor/start_git_bash.cmd
vendored
51
vendor/start_git_bash.cmd
vendored
@ -1,51 +0,0 @@
|
||||
@echo off
|
||||
|
||||
if not defined CMDER_ROOT (
|
||||
if defined ConEmuDir (
|
||||
for /f "delims=" %%i in ("%ConEmuDir%\..\..") do (
|
||||
set "CMDER_ROOT=%%~fi"
|
||||
)
|
||||
) else (
|
||||
for /f "delims=" %%i in ("%~dp0\..") do (
|
||||
set "CMDER_ROOT=%%~fi"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
if defined ConEmuDir (
|
||||
set "gitCommand=--command=%ConEmuBaseDirShort%\conemu-msys2-64.exe"
|
||||
)
|
||||
|
||||
if exist "%CMDER_ROOT%\vendor\git-for-windows" (
|
||||
set "PATH=%CMDER_ROOT%\vendor\git-for-windows\usr\bin;%PATH%"
|
||||
set "gitCmd=%CMDER_ROOT%\vendor\git-for-windows\git-cmd.exe"
|
||||
set "bashCmd=%CMDER_ROOT%\vendor\git-for-windows\usr\bin\bash.exe"
|
||||
) else if exist "%ProgramFiles%\git" (
|
||||
set "PATH=%ProgramFiles%\git\usr\bin;%PATH%"
|
||||
set "gitCmd=%ProgramFiles%\git\git-cmd.exe"
|
||||
set "bashCmd=%ProgramFiles%\git\usr\bin\bash.exe"
|
||||
if not exist "%ProgramFiles%\git\etc\profile.d\cmder_exinit.sh" (
|
||||
echo Run 'mklink "%ProgramFiles%\git\etc\profile.d\cmder_exinit.sh" "%CMDER_ROOT%\vendor\cmder_exinit"' in 'cmd::Cmder as Admin' to use Cmder with external Git Bash
|
||||
echo.
|
||||
echo or
|
||||
echo.
|
||||
echo Run 'echo "" ^> "%ProgramFiles%\git\etc\profile.d\cmder_exinit.sh"' in 'cmd::Cmder as Admin' to disable this message.
|
||||
)
|
||||
) else if exist "%ProgramFiles(x86)%\git" (
|
||||
set "PATH=%ProgramFiles(x86)%\git\usr\bin;%PATH%"
|
||||
set "gitCmd=%ProgramFiles(x86)%\git\git-cmd.exe"
|
||||
set "bashCmd=%ProgramFiles(x86)%\git\usr\bin\bash.exe"
|
||||
if not exist "%ProgramFiles(x86)%\git\etc\profile.d\cmder_exinit.sh" (
|
||||
echo Run 'mklink "%ProgramFiles^(x86^)%\git\etc\profile.d\cmder_exinit.sh" "%CMDER_ROOT%\vendor\cmder_exinit"' in 'cmd::Cmder as Admin' to use Cmder with external Git Bash
|
||||
echo.
|
||||
echo or
|
||||
echo.
|
||||
echo Run 'echo "" ^> "%ProgramFiles^(x86^)%\git\etc\profile.d\cmder_exinit.sh"' in 'cmd::Cmder as Admin' to disable this message.
|
||||
)
|
||||
)
|
||||
|
||||
if defined ConEmuDir (
|
||||
"%gitCmd%" --no-cd %gitCommand% "%bashCmd%" --login -i
|
||||
) else (
|
||||
"%bashCmd%" --login -i
|
||||
)
|
40
vendor/start_git_mintty.cmd
vendored
40
vendor/start_git_mintty.cmd
vendored
@ -1,40 +0,0 @@
|
||||
@echo off
|
||||
|
||||
if not defined CMDER_ROOT (
|
||||
if defined ConEmuDir (
|
||||
for /f "delims=" %%i in ("%ConEmuDir%\..\..") do (
|
||||
set "CMDER_ROOT=%%~fi"
|
||||
)
|
||||
) else (
|
||||
for /f "delims=" %%i in ("%~dp0\..") do (
|
||||
set "CMDER_ROOT=%%~fi"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
if exist "%CMDER_ROOT%\vendor\git-for-windows" (
|
||||
set "PATH=%CMDER_ROOT%\vendor\git-for-windows\usr\bin;%PATH%"
|
||||
set "gitCmd=%CMDER_ROOT%\vendor\git-for-windows\usr\bin\mintty.exe"
|
||||
) else if exist "%ProgramFiles%\git" (
|
||||
set "PATH=%ProgramFiles%\git\usr\bin;%PATH%"
|
||||
set "gitCmd=%ProgramFiles%\git\usr\bin\mintty.exe"
|
||||
if not exist "%ProgramFiles%\git\etc\profile.d\cmder_exinit.sh" (
|
||||
echo Run 'mklink "%ProgramFiles%\git\etc\profile.d\cmder_exinit.sh" "%CMDER_ROOT%\vendor\cmder_exinit"' in 'cmd::Cmder as Admin' to use Cmder with external Git Bash
|
||||
echo.
|
||||
echo or
|
||||
echo.
|
||||
echo Run 'echo "" ^> "%ProgramFiles%\git\etc\profile.d\cmder_exinit.sh"' in 'cmd::Cmder as Admin' to disable this message.
|
||||
)
|
||||
) else if exist "%ProgramFiles(x86)%\git" (
|
||||
set "PATH=%ProgramFiles(x86)%\git\usr\bin;%PATH%"
|
||||
set "gitCmd=%ProgramFiles(x86)%\git\usr\bin\mintty.exe"
|
||||
if not exist "%ProgramFiles(x86)%\git\etc\profile.d\cmder_exinit.sh" (
|
||||
echo Run 'mklink "%ProgramFiles^(x86^)%\git\etc\profile.d\cmder_exinit.sh" "%CMDER_ROOT%\vendor\cmder_exinit"' in 'cmd::Cmder as Admin' to use Cmder with external Git Bash
|
||||
echo.
|
||||
echo or
|
||||
echo.
|
||||
echo Run 'echo "" ^> "%ProgramFiles^(x86^)%\git\etc\profile.d\cmder_exinit.sh"' in 'cmd::Cmder as Admin' to disable this message.
|
||||
)
|
||||
)
|
||||
|
||||
"%gitCmd%" /bin/bash -l
|
174
vendor/user_init.cmd.template
vendored
174
vendor/user_init.cmd.template
vendored
@ -1,174 +0,0 @@
|
||||
@echo off
|
||||
|
||||
:: This file was autogenerated by Cmder init.bat
|
||||
::
|
||||
:: It is yours to edit and will not be touched again by Cmder.
|
||||
::
|
||||
:: If you wish to recreate this file simply rename it and Cmder will re-create it the next time it is run
|
||||
:: or run the followin command from a Cmder shell:
|
||||
::
|
||||
:: powershell -f %cmder_root%\vendor\bin\create-cmdercfg.ps1 -shell cmd [-outfile "[filename]"]
|
||||
::
|
||||
|
||||
if "%CMDER_CLINK%" == "1" (
|
||||
goto :INJECT_CLINK
|
||||
) else if "%CMDER_CLINK%" == "2" if defined WT_PROFILE_ID (
|
||||
goto :INJECT_CLINK
|
||||
) else if "%CMDER_CLINK%" == "2" (
|
||||
goto :CLINK_FINISH
|
||||
)
|
||||
|
||||
goto :SKIP_CLINK
|
||||
|
||||
:INJECT_CLINK
|
||||
%print_verbose% "Injecting Clink!"
|
||||
|
||||
:: Check if Clink is not present
|
||||
if not exist "%CMDER_ROOT%\vendor\clink\clink_%clink_architecture%.exe" (
|
||||
goto :SKIP_CLINK
|
||||
)
|
||||
|
||||
:: Run Clink
|
||||
if not exist "%CMDER_CONFIG_DIR%\settings" if not exist "%CMDER_CONFIG_DIR%\clink_settings" (
|
||||
echo Generating Clink initial settings in "%CMDER_CONFIG_DIR%\clink_settings"
|
||||
copy "%CMDER_ROOT%\vendor\clink_settings.default" "%CMDER_CONFIG_DIR%\clink_settings"
|
||||
echo Additional *.lua files in "%CMDER_CONFIG_DIR%" are loaded on startup.
|
||||
)
|
||||
|
||||
if not exist "%CMDER_CONFIG_DIR%\cmder_prompt_config.lua" (
|
||||
echo Creating Cmder prompt config file: "%CMDER_CONFIG_DIR%\cmder_prompt_config.lua"
|
||||
copy "%CMDER_ROOT%\vendor\cmder_prompt_config.lua.default" "%CMDER_CONFIG_DIR%\cmder_prompt_config.lua"
|
||||
)
|
||||
|
||||
"%CMDER_ROOT%\vendor\clink\clink_%clink_architecture%.exe" inject --quiet --profile "%CMDER_CONFIG_DIR%" --scripts "%CMDER_ROOT%\vendor"
|
||||
|
||||
if errorlevel 1 (
|
||||
%print_error% "Clink initialization has failed with error code: %errorlevel%"
|
||||
goto :CLINK_FINISH
|
||||
)
|
||||
|
||||
set CMDER_CLINK=2
|
||||
goto :CLINK_FINISH
|
||||
|
||||
:SKIP_CLINK
|
||||
%print_warning% "Skipping Clink Injection!"
|
||||
|
||||
for /f "tokens=2 delims=:." %%x in ('chcp') do set cp=%%x
|
||||
chcp 65001>nul
|
||||
|
||||
:: Revert back to plain cmd.exe prompt without clink
|
||||
prompt `$E[1;32;49m`$P`$S`$_`$E[1;30;49mλ`$S`$E[0m
|
||||
|
||||
chcp %cp%>nul
|
||||
|
||||
:CLINK_FINISH
|
||||
if not defined GIT_INSTALL_ROOT set "GIT_INSTALL_ROOT=$env:GIT_INSTALL_ROOT"
|
||||
if not defined SVN_SSH set "SVN_SSH=$env:SVN_SSH"
|
||||
if not defined git_locale set git_locale=$env:git_locale
|
||||
if not defined LANG set LANG=$env:lang
|
||||
if not defined user_aliases set "user_aliases=$env:user_aliases"
|
||||
if not defined aliases set "aliases=%user_aliases%"
|
||||
if not defined HOME set "HOME=%USERPROFILE%"
|
||||
|
||||
set PLINK_PROTOCOL=$env:PLINK_PROTOCOL
|
||||
|
||||
set "path=%GIT_INSTALL_ROOT%\cmd;%path%"
|
||||
|
||||
set path_position=append
|
||||
if %nix_tools% equ 1 (
|
||||
set "path_position=append"
|
||||
) else (
|
||||
set "path_position="
|
||||
)
|
||||
|
||||
if %nix_tools% geq 1 (
|
||||
if exist "%GIT_INSTALL_ROOT%\mingw32" (
|
||||
if "%path_position%" == "append" (
|
||||
set "path=%path%;%GIT_INSTALL_ROOT%\mingw32\bin"
|
||||
) else (
|
||||
set "path=%GIT_INSTALL_ROOT%\mingw32\bin;%path%"
|
||||
)
|
||||
) else if exist "%GIT_INSTALL_ROOT%\mingw64" (
|
||||
if "%path_position%" == "append" (
|
||||
set "path=%path%;%GIT_INSTALL_ROOT%\mingw64\bin"
|
||||
) else (
|
||||
set "path=%GIT_INSTALL_ROOT%\mingw64\bin;%path%"
|
||||
)
|
||||
)
|
||||
if exist "%GIT_INSTALL_ROOT%\usr\bin" (
|
||||
if "%path_position%" == "append" (
|
||||
set "path=%path%;%GIT_INSTALL_ROOT%\usr\bin"
|
||||
) else (
|
||||
set "path=%GIT_INSTALL_ROOT%\usr\bin;%path%"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
set "path=%CMDER_ROOT%\vendor\bin;%path%"
|
||||
|
||||
:USER_CONFIG_START
|
||||
if %max_depth% gtr 1 (
|
||||
%lib_path% enhance_path_recursive "%CMDER_ROOT%\bin" 0 %max_depth%
|
||||
) else (
|
||||
set "path=%CMDER_ROOT%\bin;%path%"
|
||||
)
|
||||
|
||||
setlocal enabledelayedexpansion
|
||||
if defined CMDER_USER_BIN (
|
||||
if %max_depth% gtr 1 (
|
||||
%lib_path% enhance_path_recursive "%CMDER_USER_BIN%" 0 %max_depth%
|
||||
) else (
|
||||
set "path=%CMDER_USER_ROOT%\bin;%path%"
|
||||
)
|
||||
)
|
||||
endlocal && set "path=%path%"
|
||||
|
||||
set "path=%path%;%CMDER_ROOT%"
|
||||
|
||||
call "%user_aliases%"
|
||||
|
||||
%lib_profile% run_profile_d "%CMDER_ROOT%\config\profile.d"
|
||||
if defined CMDER_USER_CONFIG (
|
||||
%lib_profile% run_profile_d "%CMDER_USER_CONFIG%\profile.d"
|
||||
)
|
||||
|
||||
call "%CMDER_ROOT%\config\user_profile.cmd"
|
||||
if defined CMDER_USER_CONFIG (
|
||||
if exist "%CMDER_USER_CONFIG%\user_profile.cmd" (
|
||||
call "%CMDER_USER_CONFIG%\user_profile.cmd"
|
||||
)
|
||||
)
|
||||
|
||||
set "path=%path:;;=;%
|
||||
|
||||
:CMDER_CONFIGURED
|
||||
if not defined CMDER_CONFIGURED set CMDER_CONFIGURED=1
|
||||
|
||||
set CMDER_INIT_END=%time%
|
||||
|
||||
if "%time_init%" == "1" if "%CMDER_INIT_END%" neq "" if "%CMDER_INIT_START%" neq "" (
|
||||
call "%cmder_root%\vendor\bin\timer.cmd" "%CMDER_INIT_START%" "%CMDER_INIT_END%"
|
||||
)
|
||||
|
||||
:CLEANUP
|
||||
set architecture_bits=
|
||||
set CMDER_ALIASES=
|
||||
set CMDER_INIT_END=
|
||||
set CMDER_INIT_START=
|
||||
set CMDER_USER_FLAGS=
|
||||
set debug_output=
|
||||
set fast_init=
|
||||
set max_depth=
|
||||
set nix_tools=
|
||||
set path_position=
|
||||
set print_debug=
|
||||
set print_error=
|
||||
set print_verbose=
|
||||
set print_warning=
|
||||
set time_init=
|
||||
set verbose_output=
|
||||
set user_aliases=
|
||||
|
||||
exit /b
|
||||
|
||||
|
390
vendor/windows_terminal_default_settings.json
vendored
390
vendor/windows_terminal_default_settings.json
vendored
@ -1,390 +0,0 @@
|
||||
{
|
||||
"$help": "https://aka.ms/terminal-documentation",
|
||||
"$schema": "https://aka.ms/terminal-profiles-schema",
|
||||
"actions": [
|
||||
{
|
||||
"command": {
|
||||
"action": "copy",
|
||||
"singleLine": false
|
||||
},
|
||||
"keys": "ctrl+shift+c"
|
||||
},
|
||||
{
|
||||
"command": "unbound",
|
||||
"keys": "ctrl+v"
|
||||
},
|
||||
{
|
||||
"command": "unbound",
|
||||
"keys": "ctrl+c"
|
||||
},
|
||||
{
|
||||
"command": "paste"
|
||||
},
|
||||
{
|
||||
"command": "find",
|
||||
"keys": "ctrl+shift+f"
|
||||
},
|
||||
{
|
||||
"command": {
|
||||
"action": "splitPane",
|
||||
"split": "auto",
|
||||
"splitMode": "duplicate"
|
||||
},
|
||||
"keys": "alt+shift+d"
|
||||
}
|
||||
],
|
||||
"copyFormatting": "none",
|
||||
"copyOnSelect": true,
|
||||
"defaultProfile": "{48946353-ebe8-4571-a591-7d609f31327a}",
|
||||
"newTabMenu": [
|
||||
{
|
||||
"type": "remainingProfiles"
|
||||
}
|
||||
],
|
||||
"profiles": {
|
||||
"defaults": {
|
||||
"colorScheme": "One Half Dark",
|
||||
"font": {
|
||||
"face": "Cascadia Code"
|
||||
}
|
||||
},
|
||||
"list": [
|
||||
{
|
||||
"colorScheme": "One Half Dark",
|
||||
"commandline": "cmd /k \"%WT_SETTINGS_DIR%\\..\\..\\init.bat\"",
|
||||
"guid": "{48946353-ebe8-4571-a591-7d609f31327a}",
|
||||
"hidden": false,
|
||||
"icon": "%WT_SETTINGS_DIR%\\..\\..\\..\\icons\\cmder.ico",
|
||||
"name": "Cmder",
|
||||
"startingDirectory": null,
|
||||
"tabTitle": "Cmder",
|
||||
"useAtlasEngine": false
|
||||
},
|
||||
{
|
||||
"colorScheme": "One Half Dark",
|
||||
"commandline": "%SystemRoot%\\System32\\cmd.exe /k \"%WT_SETTINGS_DIR%\\..\\..\\init.bat\"",
|
||||
"elevate": true,
|
||||
"guid": "{bdd957d0-c15a-49e6-9816-14b02351a071}",
|
||||
"hidden": false,
|
||||
"icon": "%WT_SETTINGS_DIR%\\..\\..\\..\\icons\\cmder_red.ico",
|
||||
"name": "Cmder as Admin",
|
||||
"startingDirectory": null,
|
||||
"tabTitle": "Cmder as Admin"
|
||||
},
|
||||
{
|
||||
"colorScheme": "One Half Dark",
|
||||
"commandline": "PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command \"Invoke-Expression 'Import-Module ''%WT_SETTINGS_DIR%\\..\\..\\profile.ps1'''\"",
|
||||
"guid": "{eb1f6578-ce9d-47a9-a8c7-9b3fdd22302d}",
|
||||
"hidden": false,
|
||||
"icon": "%WT_SETTINGS_DIR%\\..\\..\\..\\icons\\cmder_orange.ico",
|
||||
"name": "Cmder - PowerShell",
|
||||
"startingDirectory": null,
|
||||
"tabTitle": "Cmder",
|
||||
"useAtlasEngine": false
|
||||
},
|
||||
{
|
||||
"colorScheme": "One Half Dark",
|
||||
"commandline": "PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command \"Invoke-Expression 'Import-Module ''%WT_SETTINGS_DIR%\\..\\..\\profile.ps1'''\"",
|
||||
"elevate": true,
|
||||
"guid": "{c5225c3e-8619-4145-8182-2800814eeb17}",
|
||||
"hidden": false,
|
||||
"icon": "%WT_SETTINGS_DIR%\\..\\..\\..\\icons\\cmder_purple.ico",
|
||||
"name": "Cmder - PowerShell as Admin",
|
||||
"startingDirectory": null,
|
||||
"tabTitle": "Cmder - PowerShell as Admin",
|
||||
"useAtlasEngine": false
|
||||
},
|
||||
{
|
||||
"colorScheme": "One Half Dark",
|
||||
"commandline": "%WT_SETTINGS_DIR%\\..\\..\\start_git_bash.cmd",
|
||||
"guid": "{c5c298e9-010e-4b8c-bc55-e3df81846b4c}",
|
||||
"hidden": false,
|
||||
"icon": "%WT_SETTINGS_DIR%\\..\\..\\..\\icons\\cmder_blue.ico",
|
||||
"name": "Cmder - Bash",
|
||||
"startingDirectory": null,
|
||||
"tabTitle": "Cmder - Bash"
|
||||
},
|
||||
{
|
||||
"colorScheme": "One Half Dark",
|
||||
"commandline": "%WT_SETTINGS_DIR%\\..\\..\\start_git_bash.cmd",
|
||||
"elevate": true,
|
||||
"guid": "{545eb9ed-4c1c-49b3-8cc6-7eb41bd280ff}",
|
||||
"hidden": false,
|
||||
"icon": "%WT_SETTINGS_DIR%\\..\\..\\..\\icons\\cmder_yellow.ico",
|
||||
"name": "Cmder - Bash as Admin",
|
||||
"startingDirectory": null,
|
||||
"tabTitle": "Cmder - Bash as Admin"
|
||||
},
|
||||
{
|
||||
"commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
|
||||
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
|
||||
"hidden": false,
|
||||
"name": "Windows PowerShell"
|
||||
},
|
||||
{
|
||||
"commandline": "%SystemRoot%\\System32\\cmd.exe",
|
||||
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
|
||||
"hidden": false,
|
||||
"name": "Command Prompt"
|
||||
}
|
||||
]
|
||||
},
|
||||
"schemes": [
|
||||
{
|
||||
"background": "#0C0C0C",
|
||||
"black": "#0C0C0C",
|
||||
"blue": "#0037DA",
|
||||
"brightBlack": "#767676",
|
||||
"brightBlue": "#3B78FF",
|
||||
"brightCyan": "#61D6D6",
|
||||
"brightGreen": "#16C60C",
|
||||
"brightPurple": "#B4009E",
|
||||
"brightRed": "#E74856",
|
||||
"brightWhite": "#F2F2F2",
|
||||
"brightYellow": "#F9F1A5",
|
||||
"cursorColor": "#FFFFFF",
|
||||
"cyan": "#3A96DD",
|
||||
"foreground": "#CCCCCC",
|
||||
"green": "#13A10E",
|
||||
"name": "Campbell",
|
||||
"purple": "#881798",
|
||||
"red": "#C50F1F",
|
||||
"selectionBackground": "#FFFFFF",
|
||||
"white": "#CCCCCC",
|
||||
"yellow": "#C19C00"
|
||||
},
|
||||
{
|
||||
"background": "#012456",
|
||||
"black": "#0C0C0C",
|
||||
"blue": "#0037DA",
|
||||
"brightBlack": "#767676",
|
||||
"brightBlue": "#3B78FF",
|
||||
"brightCyan": "#61D6D6",
|
||||
"brightGreen": "#16C60C",
|
||||
"brightPurple": "#B4009E",
|
||||
"brightRed": "#E74856",
|
||||
"brightWhite": "#F2F2F2",
|
||||
"brightYellow": "#F9F1A5",
|
||||
"cursorColor": "#FFFFFF",
|
||||
"cyan": "#3A96DD",
|
||||
"foreground": "#CCCCCC",
|
||||
"green": "#13A10E",
|
||||
"name": "Campbell Powershell",
|
||||
"purple": "#881798",
|
||||
"red": "#C50F1F",
|
||||
"selectionBackground": "#FFFFFF",
|
||||
"white": "#CCCCCC",
|
||||
"yellow": "#C19C00"
|
||||
},
|
||||
{
|
||||
"background": "#282828",
|
||||
"black": "#282828",
|
||||
"blue": "#458588",
|
||||
"brightBlack": "#928374",
|
||||
"brightBlue": "#83A598",
|
||||
"brightCyan": "#8EC07C",
|
||||
"brightGreen": "#B8BB26",
|
||||
"brightPurple": "#D3869B",
|
||||
"brightRed": "#FB4934",
|
||||
"brightWhite": "#EBDBB2",
|
||||
"brightYellow": "#FABD2F",
|
||||
"cursorColor": "#FFFFFF",
|
||||
"cyan": "#689D6A",
|
||||
"foreground": "#EBDBB2",
|
||||
"green": "#98971A",
|
||||
"name": "Gruvbox Dark",
|
||||
"purple": "#B16286",
|
||||
"red": "#CC241D",
|
||||
"selectionBackground": "#FFFFFF",
|
||||
"white": "#A89984",
|
||||
"yellow": "#D79921"
|
||||
},
|
||||
{
|
||||
"background": "#272822",
|
||||
"black": "#3E3D32",
|
||||
"blue": "#03395C",
|
||||
"brightBlack": "#272822",
|
||||
"brightBlue": "#66D9EF",
|
||||
"brightCyan": "#66D9EF",
|
||||
"brightGreen": "#A6E22E",
|
||||
"brightPurple": "#AE81FF",
|
||||
"brightRed": "#F92672",
|
||||
"brightWhite": "#F8F8F2",
|
||||
"brightYellow": "#FD971F",
|
||||
"cursorColor": "#FFFFFF",
|
||||
"cyan": "#66D9EF",
|
||||
"foreground": "#F8F8F2",
|
||||
"green": "#A6E22E",
|
||||
"name": "Monokai",
|
||||
"purple": "#AE81FF",
|
||||
"red": "#F92672",
|
||||
"selectionBackground": "#FFFFFF",
|
||||
"white": "#F8F8F2",
|
||||
"yellow": "#FFE792"
|
||||
},
|
||||
{
|
||||
"background": "#282C34",
|
||||
"black": "#282C34",
|
||||
"blue": "#61AFEF",
|
||||
"brightBlack": "#5A6374",
|
||||
"brightBlue": "#61AFEF",
|
||||
"brightCyan": "#56B6C2",
|
||||
"brightGreen": "#98C379",
|
||||
"brightPurple": "#C678DD",
|
||||
"brightRed": "#E06C75",
|
||||
"brightWhite": "#DCDFE4",
|
||||
"brightYellow": "#E5C07B",
|
||||
"cursorColor": "#FFFFFF",
|
||||
"cyan": "#56B6C2",
|
||||
"foreground": "#DCDFE4",
|
||||
"green": "#98C379",
|
||||
"name": "One Half Dark",
|
||||
"purple": "#C678DD",
|
||||
"red": "#E06C75",
|
||||
"selectionBackground": "#FFFFFF",
|
||||
"white": "#DCDFE4",
|
||||
"yellow": "#E5C07B"
|
||||
},
|
||||
{
|
||||
"background": "#FAFAFA",
|
||||
"black": "#383A42",
|
||||
"blue": "#0184BC",
|
||||
"brightBlack": "#4F525D",
|
||||
"brightBlue": "#61AFEF",
|
||||
"brightCyan": "#56B5C1",
|
||||
"brightGreen": "#98C379",
|
||||
"brightPurple": "#C577DD",
|
||||
"brightRed": "#DF6C75",
|
||||
"brightWhite": "#FFFFFF",
|
||||
"brightYellow": "#E4C07A",
|
||||
"cursorColor": "#4F525D",
|
||||
"cyan": "#0997B3",
|
||||
"foreground": "#383A42",
|
||||
"green": "#50A14F",
|
||||
"name": "One Half Light",
|
||||
"purple": "#A626A4",
|
||||
"red": "#E45649",
|
||||
"selectionBackground": "#FFFFFF",
|
||||
"white": "#FAFAFA",
|
||||
"yellow": "#C18301"
|
||||
},
|
||||
{
|
||||
"background": "#002B36",
|
||||
"black": "#002B36",
|
||||
"blue": "#268BD2",
|
||||
"brightBlack": "#073642",
|
||||
"brightBlue": "#839496",
|
||||
"brightCyan": "#93A1A1",
|
||||
"brightGreen": "#586E75",
|
||||
"brightPurple": "#6C71C4",
|
||||
"brightRed": "#CB4B16",
|
||||
"brightWhite": "#FDF6E3",
|
||||
"brightYellow": "#657B83",
|
||||
"cursorColor": "#FFFFFF",
|
||||
"cyan": "#2AA198",
|
||||
"foreground": "#839496",
|
||||
"green": "#859900",
|
||||
"name": "Solarized Dark",
|
||||
"purple": "#D33682",
|
||||
"red": "#DC322F",
|
||||
"selectionBackground": "#FFFFFF",
|
||||
"white": "#EEE8D5",
|
||||
"yellow": "#B58900"
|
||||
},
|
||||
{
|
||||
"background": "#FDF6E3",
|
||||
"black": "#002B36",
|
||||
"blue": "#268BD2",
|
||||
"brightBlack": "#073642",
|
||||
"brightBlue": "#839496",
|
||||
"brightCyan": "#93A1A1",
|
||||
"brightGreen": "#586E75",
|
||||
"brightPurple": "#6C71C4",
|
||||
"brightRed": "#CB4B16",
|
||||
"brightWhite": "#FDF6E3",
|
||||
"brightYellow": "#657B83",
|
||||
"cursorColor": "#002B36",
|
||||
"cyan": "#2AA198",
|
||||
"foreground": "#657B83",
|
||||
"green": "#859900",
|
||||
"name": "Solarized Light",
|
||||
"purple": "#D33682",
|
||||
"red": "#DC322F",
|
||||
"selectionBackground": "#FFFFFF",
|
||||
"white": "#EEE8D5",
|
||||
"yellow": "#B58900"
|
||||
},
|
||||
{
|
||||
"background": "#000000",
|
||||
"black": "#000000",
|
||||
"blue": "#3465A4",
|
||||
"brightBlack": "#555753",
|
||||
"brightBlue": "#729FCF",
|
||||
"brightCyan": "#34E2E2",
|
||||
"brightGreen": "#8AE234",
|
||||
"brightPurple": "#AD7FA8",
|
||||
"brightRed": "#EF2929",
|
||||
"brightWhite": "#EEEEEC",
|
||||
"brightYellow": "#FCE94F",
|
||||
"cursorColor": "#FFFFFF",
|
||||
"cyan": "#06989A",
|
||||
"foreground": "#D3D7CF",
|
||||
"green": "#4E9A06",
|
||||
"name": "Tango Dark",
|
||||
"purple": "#75507B",
|
||||
"red": "#CC0000",
|
||||
"selectionBackground": "#FFFFFF",
|
||||
"white": "#D3D7CF",
|
||||
"yellow": "#C4A000"
|
||||
},
|
||||
{
|
||||
"background": "#FFFFFF",
|
||||
"black": "#000000",
|
||||
"blue": "#3465A4",
|
||||
"brightBlack": "#555753",
|
||||
"brightBlue": "#729FCF",
|
||||
"brightCyan": "#34E2E2",
|
||||
"brightGreen": "#8AE234",
|
||||
"brightPurple": "#AD7FA8",
|
||||
"brightRed": "#EF2929",
|
||||
"brightWhite": "#EEEEEC",
|
||||
"brightYellow": "#FCE94F",
|
||||
"cursorColor": "#000000",
|
||||
"cyan": "#06989A",
|
||||
"foreground": "#555753",
|
||||
"green": "#4E9A06",
|
||||
"name": "Tango Light",
|
||||
"purple": "#75507B",
|
||||
"red": "#CC0000",
|
||||
"selectionBackground": "#FFFFFF",
|
||||
"white": "#D3D7CF",
|
||||
"yellow": "#C4A000"
|
||||
},
|
||||
{
|
||||
"background": "#000000",
|
||||
"black": "#000000",
|
||||
"blue": "#000080",
|
||||
"brightBlack": "#808080",
|
||||
"brightBlue": "#0000FF",
|
||||
"brightCyan": "#00FFFF",
|
||||
"brightGreen": "#00FF00",
|
||||
"brightPurple": "#FF00FF",
|
||||
"brightRed": "#FF0000",
|
||||
"brightWhite": "#FFFFFF",
|
||||
"brightYellow": "#FFFF00",
|
||||
"cursorColor": "#FFFFFF",
|
||||
"cyan": "#008080",
|
||||
"foreground": "#C0C0C0",
|
||||
"green": "#008000",
|
||||
"name": "Vintage",
|
||||
"purple": "#800080",
|
||||
"red": "#800000",
|
||||
"selectionBackground": "#FFFFFF",
|
||||
"white": "#C0C0C0",
|
||||
"yellow": "#808000"
|
||||
}
|
||||
],
|
||||
"themes": [],
|
||||
"useAcrylicInTabRow": true,
|
||||
"wordDelimiters": " ()\"',;<>!@#$%^&*|+=[]{}~?\u2502"
|
||||
}
|
Reference in New Issue
Block a user