# [wpkg-users] [Bug 273] Per user install support

bugzilla-daemon at bugzilla.wpkg.org bugzilla-daemon at bugzilla.wpkg.org
Thu May 17 23:03:58 CEST 2012

http://bugzilla.wpkg.org/show_bug.cgi?id=273

--- Comment #8 from Keith Jones <k.e.jones at brighton.ac.uk>  ---
Hi Stefan,

Wow that's thinking out of the box and elegant too!

> (In reply to comment #1)
> >
> > cscript.exe \\path\to\wpkg.js /config:config-usermode.xml /host:%USERNAME%
> >
> Thats a really dirty hack, since WPKG already supports environment variable
> matching.
> Example:
> <hosts:wpkg
>         xmlns:hosts="http://www.wpkg.org/hosts"
>         xmlns:wpkg="http://www.wpkg.org/wpkg"
>         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>         xsi:noNamespaceSchemaLocation="../xsd/hosts.xsd">
>     <host hostname="^VM\-.+" profile-id="VirtuelleRechner" os="6\.[1-9]\.\d{4}"
> />
>     <host hostname="^VM\-.+" profile-id="VirtuelleRechnerRemoveAll"
>           os="(5\.\d|6\.0)\.\d{4}" environment="VM_WPKG_PROFILE=^1$" /> > <host hostname="^VM\-.+" profile-id="VirtuelleRechnerSmallTest" > os="(5\.\d|6\.0)\.\d{4}" environment="VM_WPKG_PROFILE=^2$" />
>     <host hostname="^VM\-.+" profile-id="VirtuelleRechner"
>           os="(5\.\d|6\.0)\.\d{4}" />
> </hosts:wpkg>
> Depending on the value of an environment variable the profile to apply will be
> selected.
> So the following is already possible:
> <host profile-id="AdminUser" environment="USERNAME=^Administrator$" /> > -- > Stefan Sorry for the slow reponse, I've been trying to think out my response to Rainer's replies and your solution did need a few coffees before I could work any of it out :-) Am I right to assume that if you don't supply the hostname then it's the equivalent of hostname="*"? I think that's the case. I'm still a bit confused by the ^Administrator$ bit though. I've yet to look deeply at the code. Does
that work out as an expansion of group membership? Is it really that easy? It
definately looks elegant if it is!

I think I can see where you're going; selecting a profile for all hosts but
only applying it if the filter is valid ie the environment variable USERNAME
equals the user I want to apply it to. I'm still a bit confused by the black
magic of filters :-}

I guess I'd still need to follow Rainer's advice and use an alternate config
to ensure WPKG.XML went somewhere into the user space though, otherwise WPKG
will keep trying to apply the rules every time someone logs in as they won't be
able to overwrite the system one.

today. I can only see it from my perspective, I can easily be barking up the
wrong tree.

Keith

--
Configure bugmail: http://bugzilla.wpkg.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.