Re: [wpkg-users] Check command

2009-06-12 Thread ds10025

Afternoon Rainer

Thanks again for you help and comments.

If anyone are interested I'll upload the working script (once I get 
it to work and stable)




Thanks

Dan
At 09:11 12/06/2009, Rainer Meier wrote:

Hi,

ds10...@cam.ac.uk wrote:
> Where {} is a long idea code, where can I get the id code from I've
> checked registry.

If you still have a machine where this "old" version is installed you can grab
the uninstall code from its uninstall entry within the registry:

For example on my system I found it here:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-7AD7-1033-7B44-A911}

It needs some explanations I guess...
The Wow6432Node sub-key is only there if you use a 64-bit system. On such
systems all 32-bit HKLM\SOFTWARE\* entries are re-located to that 
sub-key. So on

your 32-bit system it will be here:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-7AD7-1033-7B44-A911}

The best way to find it is to go to the enclosing "Uninstall" key and then
search for a string as it appears within the control-panel. You should end up
finding the "DisplayName" entry within the corresponding key.

Then have a look at the UninstallString. This is the uninstall 
command-line used

if you click "remove" within the control-panel -> add/remove software.

Sometimes there is a QuietUninstallString entry too which already contains the
values to silently uninstall the application. This value usually can 
be used 1:1

within a remove command in WPKG.

Also the UninstallString can usually be transformed into a silent 
uninstaller by

adding some commands. Most uninstallers support an option like -s or /s to run
it silently.
In case of Adobe Reader it looks as follows on my system...
UninstallString: MsiExec.exe /I{AC76BA86-7AD7-1033-7B44-A911}

As you can see the command-line contains the correct ID to uninstall 
it and can

be easily transformed into a silent uninstall string:
MsiExec.exe /x {AC76BA86-7AD7-1033-7B44-A911} /qn


It depends on the application packager which key is chosen. In case of Adobe
Reader this key unfortunately changes with each release or patch. 
This means you
really need to know all of them - or guess them by naming scheme 
(have a look at

the latest part of the ID, it includes the version of the reader).


> Also, is it possible to msiexec /x acrobat?

No.
You have two possibilities to use msiexec or software uninstall. 
Either you have

to specify the ID (as above) or you have to refer to the MSI package. So for
Adobe Reader the following works:

MsiExec.exe /x {AC76BA86-7AD7-1033-7B44-A911} /qn
MsiExec.exe /x \\path\to\AcroRead.msi /qn


> Also at the same time I want to remove Acrobat.com & Acrobat air,?

I don't have Acrobat.com and Acrobat Air installed but I guess they 
will create

their own Uninstall entry. If there is one follow the procedure above to find
its ID in order to uninstall it.

Personally I preferred to extract the Adobe installer and then use the Adobe
Customization Wizard 9 to modify some parameters (like disabling all online
features) so Acrobat.com does not get installed at all. Download it from:

it will generate some MST transform file, then you can use
msiexec /i \\path\to\AcroRead.msi /qn TRANSFORMS="\\path\to\AcroRead.mst"
/update "\\path\to\AdbeRdrUpd912_all_incr.msp"

In order to install Adobe Reader 9 using the transform created with the wizard
and directly apply the latest 9.1.2 patch.

Somebody might find some time to add this to the WPKG wiki...


> Is they a command that removed file as listed in the Add/remove control
> panel?

The control panel does not list files. It lists installed programs - there is
one entry for each entry within the registry key I referred to on top.
And there is no way to uninstall these entries silently - only the 
ones having a
QuietUninstallString might work but it's more an exception than the 
default that

applications specify a QuietUninstallString. So it's not possible to
automatically read the necessary commands from the registry.
As you can see from the Adobe Reader example Adobe does not even use 
the correct
'msiexec /x ...' syntax for uninstall - they use the install syntax 
(msiexec /i

...) instead. This will make you enter the installation routine when you click
the "remove" button within the control panel. In case of the Adobe installer
this will show you an option to modify or to remove the reader (maybe also to
repair it). The same effect you get if you try to (re-)install the reader by
running the installer again.


br,
Rainer



-
wpkg-users mailing list archives >> http://lists.wpkg.org/pipermail/wpkg-users/
___
wpkg-users mailing list
wpkg-users@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/wpkg-users


Re: [wpkg-users] Check command

2009-06-12 Thread Pendl Stefan
Rainer Meier wrote:
>>
Hi,

ds10...@cam.ac.uk wrote:
> Where {} is a long idea code, where can I get the id code from I've
> checked registry.

If you still have a machine where this "old" version is installed you can grab
the uninstall code from its uninstall entry within the registry:

For example on my system I found it here:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-7AD7-1033-7B44-A911}

It needs some explanations I guess...
The Wow6432Node sub-key is only there if you use a 64-bit system. On such
systems all 32-bit HKLM\SOFTWARE\* entries are re-located to that sub-key. So on
your 32-bit system it will be here:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-7AD7-1033-7B44-A911}

The best way to find it is to go to the enclosing "Uninstall" key and then
search for a string as it appears within the control-panel. You should end up
finding the "DisplayName" entry within the corresponding key.
<<
---

Hi,
I have just added my package definition for Adobe AIR to the silent 
installers category.

Searching the registry takes long in some cases, so I use the following batch 
script to extract the uninstall information to a text file, which is faster to 
search and easier to copy information into a package.

rem --- code start (watch for line wraps)
@echo off
set machine_name=\\%COMPUTERNAME%\
echo.
set /p remote_name="Enter host name (default is local host): "
echo.
if not %remote_name%X == X set machine_name=\\%remote_name%\
set script_name=%~dpn0
echo Reading Installation Information ...
reg query 
"%machine_name%HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" /s 
>"%script_name%_%machine_name:\=%.txt"
reg query 
"%machine_name%HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
 >nul 2>&1
if %ERRORLEVEL% GTR 0 goto :quit
echo.
echo Reading WOW64 Installation Information ...
reg query 
"%machine_name%HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
 /s >>"%script_name%_%machine_name:\=%.txt"
:quit
echo.
pause
rem --- code end

---
Stefan

-
wpkg-users mailing list archives >> http://lists.wpkg.org/pipermail/wpkg-users/
___
wpkg-users mailing list
wpkg-users@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/wpkg-users


Re: [wpkg-users] Check command

2009-06-12 Thread Rainer Meier
Hi,

ds10...@cam.ac.uk wrote:
> Where {} is a long idea code, where can I get the id code from I've
> checked registry.

If you still have a machine where this "old" version is installed you can grab
the uninstall code from its uninstall entry within the registry:

For example on my system I found it here:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-7AD7-1033-7B44-A911}

It needs some explanations I guess...
The Wow6432Node sub-key is only there if you use a 64-bit system. On such
systems all 32-bit HKLM\SOFTWARE\* entries are re-located to that sub-key. So on
your 32-bit system it will be here:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-7AD7-1033-7B44-A911}

The best way to find it is to go to the enclosing "Uninstall" key and then
search for a string as it appears within the control-panel. You should end up
finding the "DisplayName" entry within the corresponding key.

Then have a look at the UninstallString. This is the uninstall command-line used
if you click "remove" within the control-panel -> add/remove software.

Sometimes there is a QuietUninstallString entry too which already contains the
values to silently uninstall the application. This value usually can be used 1:1
within a remove command in WPKG.

Also the UninstallString can usually be transformed into a silent uninstaller by
adding some commands. Most uninstallers support an option like -s or /s to run
it silently.
In case of Adobe Reader it looks as follows on my system...
UninstallString: MsiExec.exe /I{AC76BA86-7AD7-1033-7B44-A911}

As you can see the command-line contains the correct ID to uninstall it and can
be easily transformed into a silent uninstall string:
MsiExec.exe /x {AC76BA86-7AD7-1033-7B44-A911} /qn


It depends on the application packager which key is chosen. In case of Adobe
Reader this key unfortunately changes with each release or patch. This means you
really need to know all of them - or guess them by naming scheme (have a look at
the latest part of the ID, it includes the version of the reader).


> Also, is it possible to msiexec /x acrobat?

No.
You have two possibilities to use msiexec or software uninstall. Either you have
to specify the ID (as above) or you have to refer to the MSI package. So for
Adobe Reader the following works:

MsiExec.exe /x {AC76BA86-7AD7-1033-7B44-A911} /qn
MsiExec.exe /x \\path\to\AcroRead.msi /qn


> Also at the same time I want to remove Acrobat.com & Acrobat air,?

I don't have Acrobat.com and Acrobat Air installed but I guess they will create
their own Uninstall entry. If there is one follow the procedure above to find
its ID in order to uninstall it.

Personally I preferred to extract the Adobe installer and then use the Adobe
Customization Wizard 9 to modify some parameters (like disabling all online
features) so Acrobat.com does not get installed at all. Download it from:

it will generate some MST transform file, then you can use
msiexec /i \\path\to\AcroRead.msi /qn TRANSFORMS="\\path\to\AcroRead.mst"
/update "\\path\to\AdbeRdrUpd912_all_incr.msp"

In order to install Adobe Reader 9 using the transform created with the wizard
and directly apply the latest 9.1.2 patch.

Somebody might find some time to add this to the WPKG wiki...


> Is they a command that removed file as listed in the Add/remove control
> panel?

The control panel does not list files. It lists installed programs - there is
one entry for each entry within the registry key I referred to on top.
And there is no way to uninstall these entries silently - only the ones having a
QuietUninstallString might work but it's more an exception than the default that
applications specify a QuietUninstallString. So it's not possible to
automatically read the necessary commands from the registry.
As you can see from the Adobe Reader example Adobe does not even use the correct
'msiexec /x ...' syntax for uninstall - they use the install syntax (msiexec /i
...) instead. This will make you enter the installation routine when you click
the "remove" button within the control panel. In case of the Adobe installer
this will show you an option to modify or to remove the reader (maybe also to
repair it). The same effect you get if you try to (re-)install the reader by
running the installer again.


br,
Rainer
-
wpkg-users mailing list archives >> http://lists.wpkg.org/pipermail/wpkg-users/
___
wpkg-users mailing list
wpkg-users@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/wpkg-users


Re: [wpkg-users] Check command

2009-06-12 Thread ds10025

Thanks Rainer for your hints.

Using the batch file sound lkike a better idea to make sure all old 
version of Acrobat reader is remove.


Just one more question.

Removing Acrobat reader or any programs.

I've notice with Acrobat Reader it needs msiexec /x {x}


Where {} is a long idea code, where can I get the id code from 
I've checked registry. Also, is it possible to

msiexec /x acrobat?

Also at the same time I want to remove Acrobat.com & Acrobat air,?


Is they a command that removed file as listed in the Add/remove control panel?

Thanks again


Dan
At 16:14 11/06/2009, Rainer Meier wrote:

Hi,

Please respond to the list as well, so everybody can see your 
answers and might

profit from the open discussions.

ds10...@cam.ac.uk wrote:
> I think I began to understand what is going on.
>
>
> If I want WPKG to remove old version of Acrobat reader first. I put the
> remove command as before the install command?

Yes, exactly. But remember that for most applications this is not necessary
because the installers are "intelligent" and will perform an upgrade if they
find an outdated version. So in most cases just running the same 
command as for

installation works for upgrades too.

But feel free to execute as many (remove-) commands before executing the
installation process.
One more hint: You might have to specify  nodes for 
your remove

commands which are likely to fail. For example if you add a command to remove
Adobe reader 5.0 (msiexec /x {ID} /qn) it might exit with a specific exit code
that it was unable to execute the command (in case reader 5.0 was 
not installed).


You might also use a batch-script to batch-uninstall all previous 
versions. For

example add a command to execute "uninstall-previous-versions.cmd" and add all
commands to this script like...

@echo off
:: removing Reader 5.0
msiexec /x {x} /qn
:: removing Reader 6.0
msiexec /x {y} /qn
...
exit /b 0



One example of a "bad" installer is the "old" Java installer. It left all
versions on the system and you had to manually remove old versions in case you
want to get rid of the binaries on the HDD.

br,
Rainer



-
wpkg-users mailing list archives >> http://lists.wpkg.org/pipermail/wpkg-users/
___
wpkg-users mailing list
wpkg-users@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/wpkg-users


Re: [wpkg-users] Check command

2009-06-11 Thread Rainer Meier
Hi,

Please respond to the list as well, so everybody can see your answers and might
profit from the open discussions.

ds10...@cam.ac.uk wrote:
> I think I began to understand what is going on.
>
>
> If I want WPKG to remove old version of Acrobat reader first. I put the
> remove command as before the install command?

Yes, exactly. But remember that for most applications this is not necessary
because the installers are "intelligent" and will perform an upgrade if they
find an outdated version. So in most cases just running the same command as for
installation works for upgrades too.

But feel free to execute as many (remove-) commands before executing the
installation process.
One more hint: You might have to specify  nodes for your remove
commands which are likely to fail. For example if you add a command to remove
Adobe reader 5.0 (msiexec /x {ID} /qn) it might exit with a specific exit code
that it was unable to execute the command (in case reader 5.0 was not 
installed).

You might also use a batch-script to batch-uninstall all previous versions. For
example add a command to execute "uninstall-previous-versions.cmd" and add all
commands to this script like...

@echo off
:: removing Reader 5.0
msiexec /x {x} /qn
:: removing Reader 6.0
msiexec /x {y} /qn
...
exit /b 0



One example of a "bad" installer is the "old" Java installer. It left all
versions on the system and you had to manually remove old versions in case you
want to get rid of the binaries on the HDD.

br,
Rainer
-
wpkg-users mailing list archives >> http://lists.wpkg.org/pipermail/wpkg-users/
___
wpkg-users mailing list
wpkg-users@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/wpkg-users


Re: [wpkg-users] Check command

2009-06-11 Thread Rainer Meier
Hi,

ds10...@cam.ac.uk wrote:
> Thanks Rainer
> 
> I'm writing a script for Acrobat reader security updates using examples
> suplied.
> 
> It need to look like:-
> 
>   While latest version of Acrobat reader is NOT install
> Remove old version
>   Install new version
>   Install any patches
>Endwhile
> 
> Cobverting this into WPKG XML
> 
> 
> If the check is false how best to group codes together?

There is no repeating of commands in WPKG during
install/upgrade/downgrade/remove. WPKG will just execute the checks, then run
appropriate commands and then check again to verify the commands did what they
are supposed to.

So the checks defined in WPKG should just verify that your desired version of
the Adobe reader are installed correctly. For example by verifying that an
uninstall entry like "Adobe Reader 9.1.2" is installed.

If the check is not true, then the install commands are run (if there is a
previous version installed already - see entry in local wpkg.xml - it will run
the upgrade commands instead).
The commands specified should make sure the updgrade went smoothly.

My Adobe reader package looks as follows:





  
  
  
  
  
  

  
  

  
  

  





So if the "Adobe Reader 9.1.2" uninstall entry does not exist it runs my
unattended.cmd (I use the same script for upgrade and installation from 
scratch).

My "unattended.cmd" will in my case just run the MSI installer to install the
reader (it does automatically upgrade old versions if they exist). If you like
you can also specify a number of commands to remove previous versions but then I
guess you have to care about a number of previous versions (users might have
version 5.x 6.x, 7.x, 8.x or older 9.x installed).

After the install/upgrade command is run WPKG will check again (using the
specified checks) if the software is installed properly. If yes, then it adds
the XML node to the local wpkg.xml and reports success. If the checks fail, then
WPKG will not add the XML node to wpkg.xml and on next WPKG execution the game
starts over.

So make sure your commands (multiple ones might be specified and they are
executed in the order they appear within the XML definition) do a one-shot
upgrade to the desired version. After executing the commands your new version
should be in place.

br,
Rainer
-
wpkg-users mailing list archives >> http://lists.wpkg.org/pipermail/wpkg-users/
___
wpkg-users mailing list
wpkg-users@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/wpkg-users


Re: [wpkg-users] Check command

2009-06-11 Thread ds10025

Thanks Rainer

I'm writing a script for Acrobat reader security updates using 
examples suplied.


It need to look like:-

  While latest version of Acrobat reader is NOT install
Remove old version
  Install new version
  Install any patches
   Endwhile

Cobverting this into WPKG XML


If the check is false how best to group codes together?



Dan
At 13:41 11/06/2009, Rainer Meier wrote:

Hi ds10025

ds10...@cam.ac.uk wrote:
> Does the check command behave like a while loop.
>
> I'm trying to understand the flow of the script.

Like WolframAlpha is used to say...
"I am not sure what do do with your input." ;-)

Each package can define one or more checks. Checks can be combined 
using logical

AND/OR conditions. Surely there is an internal loop evaluating the statements.

The most common use-case of WPKG is to synchronize software. Which means WPKG
figures out which packages are assigned to this host (via profiles) and then
uses the checks of each package to find out if it is properly 
installed or not.

If it is not installed, then it will be installed and if the checks are true
then the package considered to be already installed correctly.

br,
Rainer



-
wpkg-users mailing list archives >> http://lists.wpkg.org/pipermail/wpkg-users/
___
wpkg-users mailing list
wpkg-users@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/wpkg-users


Re: [wpkg-users] Check command

2009-06-11 Thread Rainer Meier
Hi ds10025

ds10...@cam.ac.uk wrote:
> Does the check command behave like a while loop.
> 
> I'm trying to understand the flow of the script.

Like WolframAlpha is used to say...
"I am not sure what do do with your input." ;-)

Each package can define one or more checks. Checks can be combined using logical
AND/OR conditions. Surely there is an internal loop evaluating the statements.

The most common use-case of WPKG is to synchronize software. Which means WPKG
figures out which packages are assigned to this host (via profiles) and then
uses the checks of each package to find out if it is properly installed or not.
If it is not installed, then it will be installed and if the checks are true
then the package considered to be already installed correctly.

br,
Rainer
-
wpkg-users mailing list archives >> http://lists.wpkg.org/pipermail/wpkg-users/
___
wpkg-users mailing list
wpkg-users@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/wpkg-users


[wpkg-users] Check command

2009-06-11 Thread ds10025

Does the check command behave like a while loop.

I'm trying to understand the flow of the script.



-
wpkg-users mailing list archives >> http://lists.wpkg.org/pipermail/wpkg-users/
___
wpkg-users mailing list
wpkg-users@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/wpkg-users