OK, new LODR-loader script
here. Source-code
here.
New IZArc LODR-pack
here.
LODR-batch_main-IZArc3.81.cmd
reg.exe query HKLM\SYSTEM\CurrentControlSet\Control\minint >nul 2>&1
if errorlevel 1 exit
IF NOT DEFINED sfx SET sfx=%~DP0
CALL :ProgramFiles
IF NOT DEFINED programfilesdir CALL :temp
IF NOT DEFINED programfilesdir EXIT
GOTO OK
:OK
if not exist "%programfilesdir%\IZArc\IZArc.exe" md "%programfilesdir%\IZArc"
compact /U /I /Q "%programfilesdir%\IZArc"
rem if not exist "%programfilesdir%\IZArc\IZArc.exe" junction "%sfx%\IZArc" "%programfilesdir%\IZArc"
if not exist "%programfilesdir%\IZArc\IZArc.exe" imagex /mount "%sfx%\LODR-archive-IZArc3.81.wim" 1 "%programfilesdir%\IZArc"
if not exist "%programfilesdir%\IZArc\IZArc.exe" exit
IF %programfilesdir%==%ProgramFiles% (
AutoIt3.exe "%sfx%\LODR-reg-IZArc3.81.au3"
start "IZArc" "%ProgramFiles%\IZArc\IZArc.exe"
EXIT
) ELSE (
LODR-loader.exe "%programfilesdir%\IZArc\IZArc.exe" "AutoIt3.exe ""%sfx%\LODR-reg-IZArc3.81.au3""" /patch "%~DP0\%~nx0" "ProgramFiles=%programfilesdir%"
EXIT)
:ProgramFiles
FOR /F "tokens=1 delims= " %%P IN ('fsutil fsinfo volumeinfo %ProgramFiles:~0,3% ^| FIND "NTFS"') DO SET vname=%%P
IF %vname%==File SET programfilesdir=%ProgramFiles%
GOTO :EOF
:temp
FOR /F "tokens=1 delims= " %%P IN ('fsutil fsinfo volumeinfo %TEMP:~0,3% ^| FIND "NTFS"') DO SET vname=%%P
IF %vname%==File SET programfilesdir=%TEMP:~0,2%\Programs
GOTO :EOF
[LODR]
Shortcut_number=1
Shortcut1=File Tasks\Compression\IZArc
Shortcut_Parameters1=
Icon1=LODR-icon-IZArc3.81.ico
RegFiles=LODR-reg-IZArc3.81.au3
Hardcoding=Yes
%ProgramFiles%=X:\Program Files|%SystemDrive%\Program Files
As can be seen, if %ProgramFiles% doesn't reside on ntfs disk, batch is now able to use disk where %temp% is located if it is instead ntfs. Patching of REG files is made to reflect this alternative location.
This means that it is ALWAYS necessary to list REG variables and their encoding in the REG file, whether there be hard-coding or not.
Note this crucial line when mount to %temp% drive letter:
LODR-loader.exe "%programfilesdir%\IZArc\IZArc.exe" "AutoIt3.exe ""%sfx%\LODR-reg-IZArc3.81.au3""" /patch "%~DP0\%~nx0" "ProgramFiles=%programfilesdir%"
Syntax is: LODR-loader.exe "program's_exe" "reg_injection_cmdline" /patch "current_batch_file" "variable1=variable_replacement1|variable2=variable_replacement2"
Regards,
Galapo.