Windows installer musings
Rhys Smith
Smith at cardiff.ac.uk
Fri Aug 22 05:12:47 EDT 2014
On 22 Aug 2014, at 08:32, Rod Widdowson <rdw at steadingsoftware.com> wrote:
>> Regarding editing of files, my hope was that we'd probably generate or
>> update idp.properties via Java code since Java has support for property
>> set I/O.
>
> That was mine - but I am concerned that we may lose all those useful
> comments. I haven't looked at the Properties API yet so it may be OK>
> Otherwise we need to find a way to propagate the comments.
Mmmm, it’s been a while since I looked at WiX’s support for this kind of thing (maybe WiX 3.0 or thereabouts), so maybe (hopefully!) things have changed, but from what I remember, WiX can’t deal with .properties files, but can deal with INI files.
When dealing with INI files, WiX can add lines, remove lines, add values, remove values, but with the following limitations:
* They need to be ANSI encoded (not UTF8)
* They need to live in C:\Windows (unless you do some complex customaction stuff).
You could of course edit .properties files using some customaction stuff - maybe call some VBScripting with functions in for editing properties files.
> Of course if we need to edit xml files (something I want to avoid) we *do*
> preserve comments.
If you do end up needing to edit XML files in WiX, that’s fairly easy if you’re just changing the values within named elements, using util:XmlFile. e.g. For Raptor’s WiX, I take the linux based config defaults (e.g. linux path to idp-audit.log) and change things to windows based - you use XPATH to name the element and can set values at will.
e.g.
<!-- Change the location for the Shib IdP log file (from its linux default) -->
<util:XmlFile Id='ModifyIcaEventParseShib2Location'
File='[#filRaptorIcaConfEventParse]'
Action='setValue'
ElementPath='//beans/bean[\[]@id="dataAccessRegister"[\]]/property[\[]@name="parsingModules"[\]]/list/bean[\[]@id="shibbolethAuditLFP"[\]]/property[\[]@name="logfile"[\]]/value'
Value='file:///C:\Program Files\Internet2\Shib2IdP\logs\idp-audit.log’/>
>> What I would like the upgrade to do is rename the existing conf to
>> conf.old or conf-v2 or whatever, and then selectively create or copy files
>> over into the new conf/
>
> That I'd like - I hope I can pull it off..
Should be easy enough to do using CustomActions that call VBScript (a.k.a. the WiX get out of jail free card).
Rhys.
--
Dr Rhys Smith
Identity, Access, and Middleware Specialist
Cardiff University & Janet, the UK's research and education network
email: smith at cardiff.ac.uk / rhys.smith at ja.net
GPG: 0x4638C985
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
Url : http://shibboleth.net/pipermail/dev/attachments/20140822/84b19082/attachment.bin
More information about the dev
mailing list