[wpkg-users] Updating XAMPP

Falko Trojahn nospam_ft at smi-softmark.de
Fri Dec 17 17:32:08 CET 2010


Hello Malte,
>>> i found out how to install xampp silently,
>> would you please share it with us, creating a corresponding page at
>> wpkg.org? Thanx.
> Hi Falko,
> i am new to wpkg, very new. I use it since this week.
You're welcome!
> I will have a look at how to create a page at wpkg.org, but first i
> think i should find out how to update xampp.
> Anyway, silent installation is done by:
> xampp-win32-1.7.3.exe -dC:\ -s1 -spauto
> By this, xampp is installed/copied into c:\xampp
Ok, so let's take this as an example ...
>
>> There's a file \xampp\xampp-changes.txt with the version of xampp in the
>> first line,
>> perhaps you could extract it from there or just use the date of that
>> file for checking.
> I have no clue how to do that. Is text extraction and comparison
> anywhere documented?
>
Don't think so. The best solution is checking the version of a certain
file within the xampp folder.
Or, your package could create a "version-1.7.3.txt" file, so if that
doesn't exist, the package
should be installed/upgraded. 

Regarding http://wpkg.org/Packages.xml#File - there's no check for file
date - sorry, I misremembered that. Perhaps we could make that a feature
request.

The best solution would be to find a file (exe/dll) which has a version
number which changes with every new xampp version.

So you could use e.g.
<check type="file" condition="versiongreaterorequal"
path="%SystemDrive%\xampp\apache\bin\httpd.exe" value="2.2.14" />

So your xampp package could look like this (untested):

<package
      id="pkgxampp"
      name="Xampp 1.7.3"
      revision="1730"
      reboot="false"
      priority="100">
        <check type="file" condition="exists"
path="C:\xampp\version-1.7.3.txt" />
        <check type="file" condition="versiongreaterorequal"
path="C:\xampp\apache\bin\httpd.exe" value="2.2.14" />

        <install cmd="%COMSPEC%  /c
%SOFTWARE%\xampp\xampp-win32-1.7.3.exe -dC:\ -s1 -spauto "/>
        <install cmd="%COMSPEC%  /c echo ok >c:\xampp\version-1.7.3.txt"/>

        <upgrade cmd="%COMSPEC%  /c
%SOFTWARE%\xampp\xampp-win32-1.7.3.exe -dC:\ -s1 -spauto "/>
        <upgrade cmd="%COMSPEC%  /c echo ok >c:\xampp\version-1.7.3.txt"/>

        <remove cmd='%COMSPEC%  /c rmdir /q /s "C:\xampp\" '>
                <exit code="any" />
        </remove>
        <remove cmd="%COMSPEC%  /c del /f /q c:\xampp\version-1.7.3.txt" >
                <exit code="any" />
        </remove>
    </package>

Just a few remarks:
- the checks are "AND" (not "OR") - so using one of them is enough

- I don't know the silent remove command for xampp, so just use the
right one instead of "rmdir ..."

- I choose 1730 for revision, so you could count your package versions
up 1731, 1732 ... for testing without loosing the xampp revision number

Good luck
and have a nice weekend
Falko



More information about the wpkg-users mailing list