[wpkg-users] GetMSIProperties

heiko.helmle at horiba.com heiko.helmle at horiba.com
Thu Oct 16 07:11:04 CEST 2014


you mean something like this snippet?

Set objWMIService = GetObject("winmgmts:" _

    & "{impersonationLevel=impersonate}!\\" _

    & "." & "\root\cimv2")

Set colSoftware = objWMIService.ExecQuery _

    ("Select * from Win32_Product " _

        & "Where Name LIKE '" & software & "%'")

' this sometimes bombs out for unknown reasons

on error resume next

if colSoftware.Count > 0 then

        For Each objSoftware in colSoftware

                wscript.echo objsoftware.name

                'can't use .uninstall because it causes immediate 
reboots!!!

                'objSoftware.Uninstall()

                dim msiid, rc

                msiid = objSoftware.IdentifyingNumber

                rc = WshShell.Run ("msiexec /passive /qn /norestart /x " & 
msiid & " " & extraArgs, 1, true)

                if rc = 3010 then 

                        wscript.echo "Reboot requested!"

                        rebootwanted = true

                end if

        Next

end if

This will uninstall all software starting with the string in the 
"software" variable. I also have a (even more hackish) version for non-msi 
software. This way I don't need any MSI-GUID in my WPKG-Scripts :)

Best Regards
 Heiko

"wpkg-users" <wpkg-users-bounces at lists.wpkg.org> wrote on 15.10.2014 
17:19:36:

> From: Marco <schmidt at fgcz.ethz.ch>
> To: <wpkg-users at lists.wpkg.org>
> Date: 15.10.2014 17:20
> Subject: Re: [wpkg-users] GetMSIProperties
> Sent by: "wpkg-users" <wpkg-users-bounces at lists.wpkg.org>
> 
> 
> Probably I made already a step forward ...
> The questions in my mind are:
> Why add the UUID manually to the package.xml?
> Why not using a script that does this directly while executing the
> "remove" part of the package.xml?
> 
> We are discussing to get the UUID in advance. But while the "remove" is
> running, the UUID is already known to the system. It should be possible
> to query it. Actually WPKG already searches for the "install" in the
> "check" part. Unfortunately it only checks the "version" and answers
> "true" or "false". Ideally it would fetch the "uninstall string" or the
> UUID and saves it in a way, that it could be used in the "remove" part.
> 
> Maybe it would need a lot of changes in wpkg.js.
> 
> But we could also write a script, that directly fetches the "uninstall"
> string from the registry and uses this to uninstall.
> 
> Something like this:
> <remove cmd='uninstallscript "Adobe.*"' />
> 
> Which would remove only one (maybe the first) or all programs starting
> with "Adobe".
> 
> Greetings ...
>  Marco
> 
> 
> On 15.10.2014 15:08, Paul McGrath wrote:
> > Hi Marco,
> >   I've had feedback that the clipboard function isn't working 'as 
> it was' so I am just (trying) to fix that ;-)
> > I am not a natural coder.
> > 
> > Is your suggestion that the program gets the UUID and substitutes 
> it into the MSIEXEC /x
> > 
> > Paul
> > 
> > -----Original Message-----
> > From: wpkg-users [mailto:wpkg-users-bounces at lists.wpkg.org] On 
> Behalf Of Marco
> > Sent: 15 October 2014 13:47
> > To: wpkg-users at lists.wpkg.org
> > Subject: Re: [wpkg-users] GetMSIProperties
> > 
> > I use "InstEdit" (http://www.instedit.com/).
> > But is it not as comfortable as yours.
> > 
> > Could you change the script in a way, that it could be used 
> directly in the remove command in the package.xml ?
> > 
> > Greetings ...
> >  Marco
> > 
> > 
> > On 15.10.2014 12:48, Paul McGrath wrote:
> >> Hi,
> >>
> >>   If anyone is interested I can circulate the VBScript or a compiled 
> >> EXE of a tool I developed for myself.  I just found lots of code 
> >> online and cobbled it together.
> >>
> >> You select the MSI you are working on and it displays a few useful 
> >> properties and copies the UUID to the clipboard for you to paste into 

> >> your package XML.  The useful bit I thought was putting the UUID in 
> >> the clipboard so you don't have to search for it in the registry.
> >>
> >> Here is a screen shot of the output
> >>
> >> 
> >>
> >> 
> >>
> >> Regards
> >>
> >> Paul
> >>
> >> 
> >>
> >> 
> >>
> >> ------------------------------
> >>
> >> Paul McGrath,
> >>
> >> IT Manager for St James's Campus Infrastructure and Facilities (SCIF)
> >>
> >> Including Leeds Institute of Biomedical and Clinical Sciences 
> >> (LIBACS),Leeds Institute of Cancer and Pathology (LICAP),Leeds 
> >> Institute of Rheumatological and Musculoskeletal Medicine (LIRMM) and 

> >> St James's Biomedical Services (SBS)
> >>
> >> Brenner Building,
> >>
> >> School of Medicine,
> >>
> >> University of Leeds,
> >>
> >> St James's University Hospital,
> >>
> >> Beckett Street, Leeds, LS9 7TF, UK
> >>
> >> Ext.....: Uni - 38630, NHS - (89)38630
> >>
> >> Tel.....: +44 113 34 38630
> >>
> >> Email...: j.p.mcgrath at leeds.ac.uk <mailto:j.p.mcgrath at leeds.ac.uk>
> >>
> >> Homepage: http://www.limm.leeds.ac.uk <http://www.limm.leeds.ac.uk/>
> >>
> >> 
> >>
> >>
> >>
> >> 
----------------------------------------------------------------------
> >> --- SSLrack - get your cheap cheap SSL certificates (standard, 
> >> wildcard, EV) http://www.sslrack.com/
> >> 
----------------------------------------------------------------------
> >> --- 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
> >>
> > 
-------------------------------------------------------------------------
> > SSLrack - get your cheap cheap SSL certificates (standard, wildcard, 
EV) 
> http://www.sslrack.com/
> > 
-------------------------------------------------------------------------
> > 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
> > 
-------------------------------------------------------------------------
> > SSLrack - get your cheap cheap SSL certificates (standard, wildcard, 
EV)
> > http://www.sslrack.com/
> > 
-------------------------------------------------------------------------
> > 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
> > 
> 
-------------------------------------------------------------------------
> SSLrack - get your cheap cheap SSL certificates (standard, wildcard, EV)
> http://www.sslrack.com/
> 
-------------------------------------------------------------------------
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/wpkg-users/attachments/20141016/74f79888/attachment-0003.html>


More information about the wpkg-users mailing list