Modified daedalus.bat file to access Daedalus Wallet from USB flash drive (Windows only)

daedalus

#1
@echo off

:: WINDOWS ONLY USERS

:: OPEN CMD AND TYPE " wmic logicaldisk where "drivetype='2'" get volumeserialnumber,name " TO FIND OUT YOUR USB DRIVE VOLUME SERIAL NUMBER AND REPLACE IT WITH THE ONE '424C472B' LOCATED  YOUR_USB_VOLUME_SERIAL =  (FOR EX 424C472B IS MY SERIAL)

:: COPY THE SECRET KEY FILE [secret.key] LOCATED in C:\Users\[YOUR_PC_USERNAME]\AppData\Roaming\Daedalus\Secrets-1.0\ (%APPDATA%\Daedalus\Secrets-1.0) TO YOUR USB FLASH DRIVE. AFTER COYPING IT TO YOUR USB DELETE IT FROM YOUR PC.

:: REPLACE THIS FILE [daedalus.bat] WITH THE ONE LOCATED IN C:\Program Files\Daedalus\daedalus.bat

:: MAKE SURE THE SECRET KEY FILE IS LOCATED IN THE TOP DIR OF THE USB FOR EXAMPLE E:\secret.key



::######################## USB WALLET ACCESS #################################
set YOUR_USB_VOLUME_SERIAL=424C472B

for /f "tokens=2 delims==" %%d in ('wmic logicaldisk where "drivetype='2' and volumeserialnumber='%YOUR_USB_VOLUME_SERIAL%'" get name /format:value 2^>nul') do set ada_key= %%d
set "ada_key=%ada_key: =%" 
if not exist "%ada_key%" ( 
echo NO USB DRIVE OR SECRET KEY FOUND 
PAUSE
EXIT /B 
)

SET USB=%ada_key%\secret.key
::######################## USB WALLET ACCESS #################################



SET DAEDALUS_DIR=%~dp0

start /D "%DAEDALUS_DIR%" cardano-launcher.exe --updater-windows-runner "%APPDATA%\Daedalus\Installer.bat" --node "%DAEDALUS_DIR%\cardano-node.exe" --node-log-path "%APPDATA%\Daedalus\Logs\cardano-node.log" --db-path "%APPDATA%\Daedalus\DB-1.0" --wallet "%DAEDALUS_DIR%\Daedalus.exe" --launcher-logs-prefix "%APPDATA%\Daedalus\Logs\pub" --updater "%APPDATA%\Daedalus\Installer.exe"  --configuration-file "%DAEDALUS_DIR%\configuration.yaml" --configuration-key "mainnet_wallet_win64" --node-timeout 30 ^
 ^
-n --report-server ^
-n http://report-server.cardano-mainnet.iohk.io:8080 ^
-n --log-config ^
-n log-config-prod.yaml ^
-n --update-latest-path ^
-n "%APPDATA%\Daedalus\Installer.exe" ^
-n --keyfile ^
-n "%USB%" ^
-n --logs-prefix ^
-n "%APPDATA%\Daedalus\Logs" ^
-n --db-path ^
-n "%APPDATA%\Daedalus\DB-1.0" ^
-n --wallet-db-path ^
-n "%APPDATA%\Daedalus\Wallet-1.0" ^
-n --update-server ^
-n http://update.cardano-mainnet.iohk.io ^
-n --update-with-package ^
-n --no-ntp ^
-n --tlscert ^
-n "%DAEDALUS_DIR%\tls\server\server.crt" ^
-n --tlskey ^
-n "%DAEDALUS_DIR%\tls\server\server.key" ^
-n --tlsca ^
-n "%DAEDALUS_DIR%\tls\ca\ca.crt" ^
-n --topology ^
-n "%DAEDALUS_DIR%\wallet-topology.yaml"