[wpkg-users] populate variable value from registry

Paul McGrath J.P.McGrath at leeds.ac.uk
Wed May 22 09:49:53 CEST 2013


Hi Carlos,
  I've just tested it.  The switch for an alternative directory is 
/DIR="%PROGRAMFILES(X86)%\maxima\"

This worked for me, I also had to put a '\' after the directory 'maxima' otherwise it expanded the contents into the program files folder itself.

%SOFTWARE%\maxima\maxima-5.28.0-2.exe /SILENT /DIR="%PROGRAMFILES(X86)%\maxima\" /MERGETASKS=!desktopicon

Paul

-----Original Message-----
From: wpkg-users-bounces at lists.wpkg.org [mailto:wpkg-users-bounces at lists.wpkg.org] On Behalf Of Carlos R. Pasqualini
Sent: 22 May 2013 02:44
To: wpkg-users at lists.wpkg.org
Subject: [wpkg-users] populate variable value from registry

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!


-------------------------------------------------------------------------
wpkg-users mailing list archives >> http://lists.wpkg.org/pipermail/wpkg-users/
_______________________________________________
wpkg-users mailing list
wpkg-users at lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/wpkg-users



More information about the wpkg-users mailing list