1
0
mirror of https://github.com/mintty/wsltty.git synced 2024-10-05 10:21:06 +01:00

portable installation (#306)

This commit is contained in:
mintty 2022-03-22 00:00:00 +01:00
parent 73fcc66790
commit 4caa2c34eb
5 changed files with 59 additions and 3 deletions

View File

@ -35,11 +35,23 @@ You may need to open the Properties of the installer first, tab “General”
section “Security” (if available) and select “Unblock”,
to enable the “Run anyway” button.
#### WSLtty Portable installer
For a portable installation, e.g. on a USB stick, choose the
“-install-portable.exe” file for download. Installation will prompt
for a portable installation folder interactively.
For example, choosing `U:\opt` will create and use folder
`U:\opt\wsltty` both as installation directory and configuration directory.
Portable installation does not install any start menu or desktop shortcuts
and no context menu entries. It creates a shortcut in the selected
portable installation folder to start the default WSL distribution.
#### Installation from archive ####
In case a local anti-virus guard barfs about the wsltty installer, the
release also contains a `.cab` file. Download it, open it, extract its files
to some temporary deployment directory, and invoke `install.bat` from there.
to some temporary deployment directory, and invoke `install.bat` from there,
or `install-portable.bat` for a portable installation.
#### Installation from source repository ####

27
install-portable.bat Executable file
View File

@ -0,0 +1,27 @@
@echo off
set sel="Select folder to place installation of portable wsltty"
for /f "usebackq delims=" %%f in (`powershell "(new-object -COM Shell.Application).BrowseForFolder(0, '%sel%', 0, 0).self.path"`) do set f=%%f
set instdir=%f%\wsltty
if "%f%"=="" (
echo no installation
exit
) else if not exist "%f%" (
echo invalid installation folder %instdir%
exit
)
call install "%instdir%" "%instdir%" /P
rem create shortcut
cd /D "%instdir%"
set instpath=%instdir:~2%
set target=%%COMSPEC%%
set minttyargs=/C bin\mintty.exe --WSL= --icon=/wsl.ico --configdir=. -~
set bridgeargs= -
set wdir=%instpath%
set icon=%instpath%\wsl.ico
cscript /nologo mkshortcut.vbs "/name:WSL Terminal Portable"

View File

@ -137,11 +137,16 @@ mkdir "%configdir%\themes" 2> nul:
mkdir "%configdir%\sounds" 2> nul:
rem create config file if it does not yet exist
if not exist "%configdir%\config" echo # To use common configuration in %%APPDATA%%\mintty, simply remove this file>"%configdir%\config"
if exist "%configdir%\config" goto appconfig
echo # To use common configuration in %%APPDATA%%\mintty, simply remove this file>"%configdir%\config"
if "%3" == "/P" echo # Do not remove this file for WSLtty Portable>>"%configdir%\config"
:appconfig
rem skip configuration for WSLtty Portable
if "%3" == "/P" goto end
rem distro-specific stuff: shortcuts and launch scripts
cd /D "%installdir%"
echo Configuring for WSL distributions

View File

@ -279,7 +279,7 @@ cop: copcab
mkdir -p rel
cp -fl $(CAB)/* rel/
installer: cop cab normal-installer silent-installer
installer: cop cab normal-installer silent-installer portable-installer
cab:
# build cab archive
@ -299,6 +299,16 @@ silent-installer:
# build installer
cd rel; iexpress /n wsltty-quiet.SED
InstallPrompt=Install Mintty terminal for WSL Portable?
FinishMessage=Mintty for WSL Portable installation finished
portable-installer:
# prepare build of installer
rm -f rel/$(CAB)-install-portable.exe
cd rel; sed -e "/InstallPrompt/ s/=.*/=$(InstallPrompt)/" -e "/FinishMessage/ s/=.*/=$(FinishMessage)/" -e "/AppLaunched/ s/install/install-portable/" -e "/TargetName/ s/install.exe/install-portable.exe/" wsltty.SED > wsltty-portable.SED
# build installer
cd rel; iexpress /n wsltty-portable.SED
install: cop installbat
installbat:

View File

@ -60,6 +60,7 @@ FILE24="mintty.ico"
FILE25="mkshortcut.vbs"
FILE26="dequote.bat"
FILE27="cmd2.bat"
FILE28="install-portable.bat"
[SourceFiles]
SourceFiles0=.
@ -93,4 +94,5 @@ SourceFiles0=.
%FILE25%=
%FILE26%=
%FILE27%=
%FILE28%=