From 11cc91866d7e67eeab846b8ec1ac645a946d8e9d Mon Sep 17 00:00:00 2001 From: Michael Stangl Date: Thu, 30 Jul 2026 12:13:51 +0200 Subject: [PATCH] Fix: Harte Pfade zu setenv.bat in Batch-Skripten entfernt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit getexdraw.bat, ioconverter.bat und tr2txt.bat riefen setenv.bat über einen fest kodierten Pfad (C:\kabellaengen\bin\setenv.bat) auf, der bei jeder Installation per dropItem_create.bat ins Repo zurückgeschrieben wurde. Jetzt wie in tr2dxf*.bat über %~dp0 aufgelöst, damit die Skripte unabhängig vom Installationsort funktionieren. Der dafür nötige PowerShell-Replace-Hack in dropItem_create.bat entfällt damit. --- bin/dropItem_create.bat | 11 ----------- bin/getexdraw.bat | 2 +- bin/ioconverter.bat | 2 +- bin/tr2txt.bat | 2 +- 4 files changed, 3 insertions(+), 14 deletions(-) diff --git a/bin/dropItem_create.bat b/bin/dropItem_create.bat index 29bb2cf..e45a916 100644 --- a/bin/dropItem_create.bat +++ b/bin/dropItem_create.bat @@ -36,17 +36,6 @@ set SHORTCUT_ES=%INSTALL_DIR%\tr_dxf2ES.lnk set TARGET_ES=%PROJECT_BIN%\tr2dxf_es.bat set ICON_ES=%PROJECT_DOC%\img\Icons\dxfES.ico -REM ersetze die Zeile mit setenv.bat durch die mit dem neuen Pfad -powershell -Command "(Get-Content getexdraw.bat) -replace '^.*setenv.bat$', 'call %PROJECT_BIN%\setenv.bat' | Set-Content getexdraw.bat" -powershell -Command "(Get-Content ioconverter.bat) -replace '^.*setenv.bat$', 'call %PROJECT_BIN%\setenv.bat' | Set-Content ioconverter.bat" -powershell -Command "(Get-Content tr2txt.bat) -replace '^.*setenv.bat$', 'call %PROJECT_BIN%\setenv.bat' | Set-Content tr2txt.bat" - -powershell -Command "(Get-Content tr2dxf_cs.bat) -replace '^.*setenv.bat$', 'call %PROJECT_BIN%\setenv.bat' | Set-Content tr2dxf_cs.bat" -powershell -Command "(Get-Content tr2dxf_en.bat) -replace '^.*setenv.bat$', 'call %PROJECT_BIN%\setenv.bat' | Set-Content tr2dxf_en.bat" -powershell -Command "(Get-Content tr2dxf_fr.bat) -replace '^.*setenv.bat$', 'call %PROJECT_BIN%\setenv.bat' | Set-Content tr2dxf_fr.bat" -powershell -Command "(Get-Content tr2dxf_it.bat) -replace '^.*setenv.bat$', 'call %PROJECT_BIN%\setenv.bat' | Set-Content tr2dxf_it.bat" -powershell -Command "(Get-Content tr2dxf_es.bat) -replace '^.*setenv.bat$', 'call %PROJECT_BIN%\setenv.bat' | Set-Content tr2dxf_es.bat" - REM Icon1 anlegen für getexdraw powershell -Command "$s=(New-Object -COM WScript.Shell).CreateShortcut('%SHORTCUT1%');$s.TargetPath='%TARGET1%';$s.IconLocation='%ICON1%';$s.Save()" REM Icon2 anlegen für Ioconverter diff --git a/bin/getexdraw.bat b/bin/getexdraw.bat index 0c435a4..60e7ae9 100644 --- a/bin/getexdraw.bat +++ b/bin/getexdraw.bat @@ -6,7 +6,7 @@ for %%i in ("%~1") do ( set "EXT=%%~xi" set "DIR=%%~dpi" ) -call C:\kabellaengen\bin\setenv.bat +call "%~dp0setenv.bat" REM echo Dateiname ohne Erweiterung: %FILENAME% REM echo Erweiterung: %EXT% diff --git a/bin/ioconverter.bat b/bin/ioconverter.bat index c32b11a..f00c67b 100644 --- a/bin/ioconverter.bat +++ b/bin/ioconverter.bat @@ -6,7 +6,7 @@ for %%i in ("%~1") do ( set "EXT=%%~xi" set "DIR=%%~dpi" ) -call C:\kabellaengen\bin\setenv.bat +call "%~dp0setenv.bat" REM echo Dateiname ohne Erweiterung: %FILENAME% REM echo Erweiterung: %EXT% diff --git a/bin/tr2txt.bat b/bin/tr2txt.bat index ebcd6a8..ab25789 100644 --- a/bin/tr2txt.bat +++ b/bin/tr2txt.bat @@ -6,7 +6,7 @@ for %%i in ("%~1") do ( set "EXT=%%~xi" set "DIR=%%~dpi" ) -call C:\kabellaengen\bin\setenv.bat +call "%~dp0setenv.bat" REM echo Dateiname ohne Erweiterung: %FILENAME% REM echo Erweiterung: %EXT%