Loadinf & %ProgramFiles%

Hi there

We have been installing pdfforge since V 0.9x and love it.

We use the Loadinf method but have a problem because we want to state Dir=%ProgramFiles% but it doesn't seem to work.

Specifying a usual path doesn't really do the trick when using various languages and or various operating systems (XP and 7)

Kind regards

 

Patrick 

Solved it this way:

@cls

@Rem Unattended setup of pdfcreator
@Rem 2010 by patrick (at) freeclimbers.ch
@Rem Various inspirations from the web
@Rem User freely...
@Rem Depending on Version, we first install latest GhostScript Version
@Rem This is currently (V1.10) superceded
@Rem For a unknown reason, we need to change local dir
@Rem pushd %~dp0PDFCreator\\GhostScript
@Rem start /w %~dp0PDFCreator\\GhostScript\\setupgs.exe "%ProgramFiles%\\GhostScript"
@Rem popd
@Rem Remove StartMenu Entry (German XP only here!)
@Rem rmdir /s /q "%AllUsersProfile%\\startmen\\Programme\\GhostScript"

@Rem Install latest PDFCreator with or w/o included GhostScript (defined in PDFCreator.inf)
@Rem Use Text replace to enable use of system variables (%ProgramFiles%)

@echo off
if exist %tmp%\\pdfcreator.inf del %tmp%\\pdfcreator.inf
for /f "tokens=*" %%a in (%~dp0\\pdfcreator\\pdfcreator.inf) do call :AddText "%%a

start /w %~dp0PDFCreator\\PDFCreator-1_1_0_setup.exe /LOADINF=%tmp%\\PDFCreator.inf /SP- /NORESTART /VERYSILENT
if exist %tmp%\\pdfcreator.inf del %tmp%\\pdfcreator.inf

exit /b

:AddText %1
set Text=%~1%
if "%Text%"=="Dir=[ReplaceMe]" (
echo Dir=%ProgramFiles%\\pdfcreator >> %tmp%\\pdfcreator.inf) else (
echo %Text% >> %tmp%\\pdfcreator.inf)
exit /b