[wpkg-users] populate variable value from registry

Carlos R. Pasqualini pasqualinic at fcal.uner.edu.ar
Wed May 22 03:44:12 CEST 2013


Hi guys!


i'm trying to make a more usable maxima package definition for base see:
http://wpkg.org/Maxima

On each version update you need to define everything from scratch, i
want to use more variables and less paths...

So my xml (watch for mail client's wraps) was:
-----------------------------------------------------------
<package 
 id="maxima"
 name="Maxima" 
 revision="%PKG_VERSION%"
 reboot="false"
 priority="10">

 <variable name="PKG_VERSION" value="5.28.0-2" />
 <variable name="PKG_SETUP" value="%SOFTWARE%\math\maxima\maxima-%
PKG_VERSION%.exe" />
 <variable name="PKG_INSTDIR" value="%PROGRAMFILES%\maxima" />
 <variable name="PKG_INSTDIR" value="%PROGRAMFILES(X86)%\maxima"
architecture="x64" />


 <check type="uninstall" condition="versiongreaterorequal"
path="Maxima.+" value="%PKG_VERSION%" />

 <install cmd='"%PKG_SETUP%" /VERYSILENT /SUPPRESSMSGBOXES /D="%
PKG_INSTDIR%" /MERGETASKS=!desktopicon /LANG=es' >
 <exit code='0' />
 </install>


 <upgrade include="remove" />
 <upgrade include="install" />
 <downgrade include="upgrade" />

 <remove cmd='"%PKG_INSTDIR%\uninst\unins000.exe" /VERYSILENT' />

</package>
-----------------------------------------------------------

I'm having issues with the installer, because it won't honours the /D
modifier and insist on install in the folder:
%PROGRAMFILES%\Maxima-5.28.0-2

with that install folder i will have a problem in the next update,
because i will not have a way to know which was the older install
directory, frustrating the execution of the uninstaller.


as i cannot found any other way to specify another install directory
inside %Programfiles% (i think there is a bug in the maxima's installer
creation scripts, will see that later with the maxima folks) as a
workaround i tough to save the path in the registry on install time, and
read that value to a variable on the next update, but can't find in the
documentation info about saving the content of a registry value in a
variable that can be used in WPKG's xml

Can it be done? reading the registry without any CMD sorcery?
I think it could be useful something like (i'm dreaming):
<variable 
   name="PKG_OLDINSTDIR"
   registryvalue="HKLM\PATH\TO\registryKey" />

i tough to use "%COMSPEC% /C reg query HKLM\PATH\TO /v registryKey" but
the output it's too much info not just the value, and i don't know if i
can execute a command to populate a variable (i will test it tomorrow,
here in Argentina are almost 23:00pm, time to go home).



Thanks!





More information about the wpkg-users mailing list