[wpkg-users] failing check condition with a variable

Jens Kalinowsky mailinglisten at kalinowsky.de
Mon Apr 29 08:34:54 CEST 2024


Am 24.04.2024 um 20:32 schrieb Andreas Schamanek:

I had already answered Andreas directly, but here again for the mailing 
list:

> Am I misunderstanding something, or is the reason really relatively 
> obvious?
> "3.00" != "3.0.0.0"

oh yes, how embarrassing. At some point I was blind after all the tests 
yesterday. I had been concentrating on the fact that the variable name 
was in the log, so I assumed that it wasn't expanded, and overlooked the 
actual target value.

I expected the variables in the log file to be expanded. However, I have 
now read that this is an expected behavior:
https://wpkg.org/FAQ:en#Why_aren.27t_my_variables_showing_up_.28.22expanding.22.29_in_my_logs.3F

I have another question about the behavior of the variables, which I 
can't explain yet.

The following excerpt from a package is given:

<variable name="PKG_VERSION"       value="4.67" />
<variable name="PKG_VERSION_SHORT" 
value="%PKG_VERSION:~0,1%%PKG_VERSION:~-2%" />
<variable name="PKG_SETUP_IVIEW" 
value="iview%PKG_VERSION_SHORT%g_x64_setup.exe" architecture="x64" />
...
<command type="install" cmd="%COMSPEC% /c echo PKG_VERSION: 
'%PKG_VERSION%'       >  %temp%\info.txt" />
<command type="install" cmd="%COMSPEC% /c echo PKG_VERSION_SHORT: 
'%PKG_VERSION_SHORT%' >> %temp%\info.txt" />
<command type="install" cmd="%COMSPEC% /c echo PKG_SETUP_IVIEW: 
'%PKG_SETUP_IVIEW%'   >> %temp%\info.txt" />
<command type="install" cmd="%PKG_SOURCE%\%PKG_SETUP_IVIEW%" /silent 
/folder="%PKG_DESTINATION%" /desktop=0 /group=1 /allusers=1 /assoc=1' />

The excution of the setup command fails:

2024-04-29 07:48:17, ERROR   : Command '"%PKG_SOURCE%\%PKG_SETUP_IVIEW%" 
/silent /folder="%PKG_DESTINATION%" /desktop=0 /group=1 /allusers=1 
/assoc=1' 
('"\\smh\admin\install\Grafik\iview%PKG_VERSION:~0,1%%PKG_VERSION:~-2%g_x64_setup.exe" 
/silent /folder="C:\Program Files\Irfanview" /desktop=0 /group=1 
/allusers=1 /assoc=1') was unsuccessful.|Das System kann die angegebene 
Datei nicht finden.|

But the debug output seems to be fine:

PKG_VERSION:       '4.67'
PKG_VERSION_SHORT: '467'
PKG_SETUP_IVIEW:   'iview467g_x64_setup.exe'

If I change the variable definition PKG_VERSION_SHORT to the static 
value '467' the package works.

If I leave the variable PKG_VERSION_SHORT dynamic as described above, so 
that it depends on PKG_VERSION and put an '%COMSPEC% /c start "" /wait' 
in front of the setup command, it works also.

Can someone explain this to me?

Jens




More information about the wpkg-users mailing list