[wpkg-users] Access base dir in package definition

Oliver Sauder os at esite.ch
Wed May 14 16:25:17 CEST 2014


While implementing the wrapper script have I discovered another issue.
We currently use wpkg-gp and use wpkg to deploy it so the SOFTWARE
variable needs to be set accordingly otherwise it won't work and a new
wpkg-gp with the new settings won't be deployed.

So currently I define the SOFTWARE variable in the profiles.xml. But the
easiest way actually would be to define it in config.xml as you have
mentioned should be possible and the wrapper script can then just use a
different config.xml.

I was not able to define any variables in config.xml though

tried the following:
<param name='SOFTWARE' value='\\path-to-server' />

but this doesn't seem to work. Any suggestion how to define variables in
config.xml (the schema doesn't suggest that there are other possibilities)?

Cheers,
Oliver

On 13.05.2014 17:32, Oliver Sauder wrote:
> Yep a wrapper script should do the trick, although this has the
> disadvantage that all different calls have to call the wrapper script.
> Doable but will give me some work to reconfigure all systems/scripts...
> 
> We usually bundle wpkg together with packages. So if there is a
> different location there will always be a wpkg.js available. I see your
> point that this might not be desirable as it is kind of a duplication of
> data but in general not such a big deal so I do not worry to have the
> software packages and wpkg in one structure. And in the end is it always
> possible to overwrite the SOFTWARE variable if really necessary.
> 
> For now we have put the location as variable in the config.xml but a bit
> annoying to change such and I guess the wrapper script should be more
> convenient.
> 
> Thanks,
> Oliver
> 
> On 13.05.2014 12:39, Rainer Meier wrote:
>> Hi Oliver,
>>
>> On 13.05.2014 10:23, Oliver Sauder wrote:
>>> This way I can copy wpkg repo to whatever location I want and simply
>>> call in on the command line where it is located. No changes needed in
>>> the wpkg repository itself.
>>>
>>> Does that make sense?
>>
>> I guess you're doing similar setup as I do by synchronizing the software
>> tree and wpkg to USB drives. Though I do not really recommend to have
>> the software tree located in a sub-folder of wpkg installation. I have
>> initially started building my software repository exaclty as in examples
>> found on the wiki. There it recomments to use any variable likke
>> %SOFTWARE% to refer to your software.
>>
>>
>> So all commands use this variable like
>> <command type="install" cmd='"%SOFTWARE%\mysoftware\installer.exe" /s' />
>>
>> As you need to launch WPKG with some arguments anyway it's usually
>> launched from a CMD lanucher (or WPKG client) or any sort of
>> bootstrapper. In order to define global variables just define them
>> before cscript.exe is involved:
>>
>> @echo off
>> :: Define SOFTWARE variable.
>> set SOFTWARE=%~dp0
>> cscript.exe "%~dp0wpkg.js" /synchronize ...
>>
>> This nice little bootstrapper would launch WPKG and exposes the SOFTWARE
>> variable to point to the folder it is launched within.
>>
>> Alternatively you can define variables within WPKG itself:
>> - globally in config.xml
>> - per-host in hosts.xml
>> - per-profile in profiles.xml
>> - per-package in package XML
>>
>>
>> Actually I do not recommend to try specifying paths in packages relative
>> to WPKG installation path. Imagine the use-case where you want to fetch
>> software packages from different server or drive than WPKG location.
>> Relying on a hard-coded path to WPKG would require you then to update
>> all the packages. Therefore it's better to use an independent variable
>> which points to the location of WPKG installation.
>> If you need it to be auto-evaluated, then simply evaluate the location
>> in the bootstrapper script as outlined above.
>>
>>
>> br,
>> Rainer
>>
> -------------------------------------------------------------------------
> Hotel discounts, best prices: http://www.booking.com/index.html?aid=366545
> -------------------------------------------------------------------------
> 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