This is what I have. Because I couldn't find other solutions I made this up. It loads qgis.bat as a textfile. For every line in the textfile the @osgeo4w@ is replaced by $InstallDir64$. Every line is written to a new empty stringlist, and this new stringlist is saved to a textfile.
Code: Alles auswählen
[Actions]
DefVar $InstallDir64$
DefVar $ProductId$
DefStringList $newtextfile$
DefStringList $textfile$
DefVar $file$
DefVar $patchfile$
DefVar $testline$
Set $ProductId$ = "qgis"
Set $InstallDir64$ = "%ProgramFiles64Dir%\QGIS"
set $file$ = $InstallDir64$ + "\bin\qgis.bat"
Sub_PatchFile
[Sub_PatchFile]
Set $patchfile$ = $file$
if FileExists($patchfile$)
set $textfile$ = loadTextFile($patchfile$)
for $line$ in $textfile$ do Sub_PatchLine
saveTextFile($newtextfile$,$patchfile$)
endif
[Sub_PatchLine]
set $testline$ = '$line$'
if contains($testline$, "@osgeo4w@")
set $testline$ = stringReplace($testline$, "@osgeo4w@", $InstallDir64$)
endif
set $newtextfile$ = addtolist($newtextfile$,$testline$)
Code: Alles auswählen
[2] [aug 16 20:14:09:989] Syntax Error in Section: Sub_PatchFile (Command in line 403 in section: Sub_PatchFile file: setup3264.opsiscript section start at line: 398; origin: setup3264.opsiscript line: 403): saveTextFile -> undefined