From f347b3458d2411c3ac0b81a9ca332f30a1278de4 Mon Sep 17 00:00:00 2001 From: "Michael H.G. Schmidt" Date: Mon, 20 Feb 2023 12:00:51 +0100 Subject: [PATCH] bugfixes --- 06_Copy2Media.cmd | 2 +- scripts/autoconfig.cmd | 4 ---- source/searchreplace.pb | 39 ++++++++++++++++++++++++++++++--------- tools/searchreplace.exe | Bin 18944 -> 19968 bytes 4 files changed, 31 insertions(+), 14 deletions(-) diff --git a/06_Copy2Media.cmd b/06_Copy2Media.cmd index 3969e1d..fe8856d 100644 --- a/06_Copy2Media.cmd +++ b/06_Copy2Media.cmd @@ -123,7 +123,7 @@ if "@%localadmin_password%" NEQ "@" ( echo. tools\searchreplace %DRIVE%\autounattend.xml ___MYUSER___ "%MYUSER%" tools\searchreplace %DRIVE%\autounattend.xml ___MYNAME___ "%MYNAME%" -tools\searchreplace %DRIVE%\autounattend.xml ___MYPASS___ "%MYPASS%" +tools\searchreplace %DRIVE%\autounattend.xml ___MYPASS___ "%MYPASS%" /S tools\searchreplace %DRIVE%\autounattend.xml ___MYLANG___ "%LANG%" if NOT EXIST %SOURCES%\%BOOTFILE% ( diff --git a/scripts/autoconfig.cmd b/scripts/autoconfig.cmd index 9acde37..2fd0d0f 100644 --- a/scripts/autoconfig.cmd +++ b/scripts/autoconfig.cmd @@ -261,10 +261,6 @@ echo ### FINALIZING ### echo ##################### echo. -rem set ALL permissions ... -call %SystemDrive%\set-permissions.cmd -echo. - rem enable updates again (doing it as late as possible) ... if %windows_updates% == 1 ( call enable-updates.cmd diff --git a/source/searchreplace.pb b/source/searchreplace.pb index 9210def..0c1baaa 100644 --- a/source/searchreplace.pb +++ b/source/searchreplace.pb @@ -4,34 +4,49 @@ ; LICENSE : GPL ; AUTHOR : Michael H.G. Schmidt ; EMAIL : michael@schmidt2.de -; DATE : 20210328 +; DATE : 20230220 ; ------------------------------------------------------------ ; OpenConsole() -; check commandline ... -If ( CountProgramParameters() <> 3 ) +Procedure Usage() ConsoleColor(14,0) PrintN("") - PrintN("usage: searchreplace ") + PrintN("usage: searchreplace [/S]") PrintN("") ConsoleColor(15,0) PrintN("search a string in a file and replace all occurences") PrintN(" oldstring: string to search") PrintN(" newstring: string to replace") + PrintN(" /S: silent/hide output (use this for passwords!)") ConsoleColor(7,0) PrintN("") End 99 +EndProcedure + +; check commandline ... +If ( CountProgramParameters() < 3 Or CountProgramParameters() > 4 ) + Usage() EndIf +; vars +tempfile$ = workfile$ + "_T" +silent=0 + ; get arguments ... workfile$ = ProgramParameter(0) oldstring$ = ProgramParameter(1) newstring$ = ProgramParameter(2) -; vars -tempfile$ = workfile$ + "_T" +; hide output +If ( CountProgramParameters() = 4 ) + If (UCase(ProgramParameter(3)) = "/S" ) + silent=1 + Else + Usage() + EndIf +EndIf ; ; MAIN @@ -52,7 +67,12 @@ If Not OpenFile(1, tempfile$, #PB_File_SharedWrite | #PB_File_NoBuffering) End 99 EndIf -PrintN("working on [ "+ workfile$ +" ] and replacing string [ "+ oldstring$ +" ] With [ "+ newstring$ +" ] ...") +If ( silent = 1 ) + PrintN("working on [ "+ workfile$ +" ] and replacing string [ "+ oldstring$ +" ] With [ ******** ] ...") +Else + PrintN("working on [ "+ workfile$ +" ] and replacing string [ "+ oldstring$ +" ] With [ "+ newstring$ +" ] ...") +EndIf + Repeat ; read a line ... line$ = ReadString(0) @@ -75,6 +95,7 @@ DeleteFile(workfile$,#PB_FileSystem_Force) dummy = RenameFile(tempfile$, workfile$) ; IDE Options = PureBasic 5.73 LTS (Windows - x64) -; CursorPosition = 54 -; FirstLine = 30 +; CursorPosition = 68 +; FirstLine = 49 +; Folding = - ; EnableXP \ No newline at end of file diff --git a/tools/searchreplace.exe b/tools/searchreplace.exe index 5df9e68511d1585279ee5ec141bb05a2bca02a0a..6a3d8b5ef5c8a5ab09dc9eb72f6c029cc01e0a44 100644 GIT binary patch delta 7566 zcmcIpdw3L8vOnF)kOY{#J8#H@OdgO2c>zfPNx}p=Fkq1PO9CM=co8E^1QD5F$S$+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