Re: [wpkg-users] package is run one more time after removal

2009-06-04 Thread simplesi

You are the current maintainer of a multi-purpose tool that has been around
and used by a number of people for a long time.

I have used WPKG across about 10 primary schools (ages 5-11) where secure
locked down networks are not required or needed.

I believe that my suggestion of WPKG doing nothing if not instructed to do
so is a reasonable suggestion.

I don't expect that WPKG would be changed straight away just because I asked
for it to be done.

I do expect to be listened to and not told that I am doing things wrong :)

You seem to have decided I am a bad person and that my suggestions/ideas are
of very low value.

I understand why you have modifed WPKG to work in the way it does to handle
complex uninstall issues/bugs.

That is good for you :)

You do not seem able to understand that I do not have these issues but have
much simpler ones. :)

I am basically asking for WPKG to be slightly modified so that the
/noforcedremove flag means that WPKG will not remove anything under any
circumstances and not just the circumstances stated in the current
config.xml documentation

I believe I've know how to make this change but obviously I don't know if it
would affect the stability of WPKG in other areas.

I believe that my suggestion would be a very useful one during
debugging/testing of hosts/profiles/packages and save time and effort during
these phases and would have no negative effects on anyone choosing not to
use the /noforcedremove flag. :)

regards

Simon


-- 
View this message in context: 
http://www.nabble.com/package-is-run-one-more-time-after-removal-tp23834091p23864857.html
Sent from the WPKG - Users mailing list archive at Nabble.com.

-
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] package is run one more time after removal

2009-06-04 Thread Rainer Meier
Hi Simon,

If you allow me to make one more proposal...

simplesi wrote:
 The irritation is that I have removed a package from a profile but WPKG
 thinks it is OK to run the package one more time :)

I would like to know if WPKG would behave as you expected if you comment out (or
delete) line 4547 (WPKG 1.1.1-RC0) which reads

installPackage(serverPackage);

If you remve it (or the whole for-loop around it) then WPKG will not do the
upgrade-before-remove procedure. Thus not running your install commands of the
package once again before it runs the remove commands (none in your case).

You might combine this with the /noremove flag to prevent WPKG to execute any
remove commands. Well, in your case there should be no difference because you do
not specify any remove commands. Therefore I suggest not to use the /noremove
flag because it might affect other packages (where you define some remove 
strings).


If that works for you I am thinking about to make the upgrade-before-remove
feature optional by introducing a new flag to disable it. For most use-cases
this feature assists self-healing of the package structure but it would enable
you to switch it off in order to prevent that packages which are removed are
verified (and in your case (execute=always, no checks) that these packages are
run once more right before removal).

Please report if commenting/removing the line referred above gives you the
functionality you would like to have.


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] package is run one more time after removal

2009-06-04 Thread simplesi


Rainer Meier wrote:
 
 Hi Simon,
 
 If you allow me to make one more proposal...
 
 
Thank you very much for your proposal. :-)

I will try out your suggestion and get back to you as quickly as possible :)

regards

Simon
-- 
View this message in context: 
http://www.nabble.com/package-is-run-one-more-time-after-removal-tp23834091p23866485.html
Sent from the WPKG - Users mailing list archive at Nabble.com.

-
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] package is run one more time after removal

2009-06-04 Thread Rainer Meier
Hi Simon,

simplesi wrote:
 Another possibility, (But a lot more work!) would be to check to see if an
 uninstall parameter exists - if no parameter exists then WPKG could ignore
 the installPackage(serverPackage) line automatically - if an uninstall
 parameter exists then the existing behaviour of trying to update before
 removal could be kept.

Unfortunately I think this would not work as expected. Remember that the
installPackage() method is there to verify the package and its install state. It
is also used to make sure the latest/assigned version of the package is
installed on the client. So the synchronize method uses it to upgrade packages.
Making installPackage() ignoring packages which have no uninstall strings would
prevent any upgrade (upgrades are done by the same method). In general I would
say it's not correct to threat packages differently if they do not have remove
commands. Especially because this would render the upgrade-before-remove feature
useless in case the administrator completely forgot to specify any remove
commands (which is probably one of the most common reasons to use the
upgrade-before-remove feature - just adding the missing commands, increase
version and remove it from the profile).

More over if you would have uninstall entries and somebody tries to do the same
as you did with an execute=always package then WPKG would still run the install
commands once more (unless appropriate checks are defined). The different states
of a package are a bit complicated and it's difficult to do such a change by
making sure not to break any existing package.

So for the moment an option to disable the upgrade-before-remove functionality
would be sufficient.
So expect that I will add such an option soon. I will let you know when it's
ready. Until then feel free to use your modified wpkg.js ;-)

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] package is run one more time after removal

2009-06-03 Thread Falko Trojahn
Hello Simon,
 Rainer Meier wrote:
   
 However the issue you face with your packages might come from the fact
 that you
 did not specify appropriate checks for the packages. From your description
 I
 have to assume that you do not specify any checks. As a result the
 WPKG-internal
 isInstalled() check will return false for the package. That means that
 WPKG will
 re-install all these packages having no checks during synchronization.
 To prevent this you might specify the execute=once attribute to the
 package.
 Once-Packages are just installed once and then WPKG does not use the
 checks to
 verify if they are installed - WPKG just trusts that they still are.
 

 This package is a execute=always, as it is a script to be run if the
 computer is connected to the school network and not run if the computer is
 not connected (e.g laptop at home) and the computer can't reach the school
 server over a LAN.

 I think it is incorrect logic for a package to be run if it is not in the
 profile of the designated host.

 I don't think it used to work that way and it seems to have been introduced
 as a work-around for uninstall issues.

 This behaviour was very confusing when I was testing the package until I
 realised what was happening.

   
what I understand here is:

* you have package with execute=always

* you complain about: if this package is removed from the profile,
  wpkg should do nothing, if there is no uninstall entry

Is this understanding correct?


If yes: please have a look at the /noforcedremove and /noremove
parameters or
search for these in the mailing list.


 Could WPKG be modified that if a package has no uninstall script then
 WPKG
 does not try to do anything except report the information if console
 messages are enabled.
   
 It's already doing this. If there are no uninstall commands WPKG will not
 do
 anything and then use the checks if the package is removed correctly. If
 you do
 not specify any checks this removes the package from local wpkg.xml
 without
 applying any change to the system.
 

 No - what I mean is not do anything at all (apart from send/log message) -
 No uninstall - WPKG does nothing - doesn't run package one more time -
 doesn't remove wpkg.xml entry.
   

So, if you remove the package from the profile or the profile (containing
this package) from the host - why should wpkg leave the package in it's
wpkg.xml?

Could you please provide examples of your xmls (only the concerned
sections would be ok)
 and full debug log when this situation is in effect:

- hosts.xml, profiles.xml, packages.xml
- wpkg.xml
- full log (using logLevel=0xFF)

Thanx,
Falko
-
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] package is run one more time after removal

2009-06-03 Thread simplesi


Rainer Meier wrote:
 
 You did not answer yet if your packages define some checks.
 
I believe I published my package in my last post - I think you missed it :)
It does not have any checks


 The only difference (and that's what is irritating you I think) is that
 WPKG is
 going to verify the package on each run.
 
The irritation is that I have removed a package from a profile but WPKG
thinks it is OK to run the package one more time :)

I don't call that verification - I call that program execution.

I can understand why it has been introduced to deal with debugging faulty
uninstall scripts but don't see why it cannot behave in a more logical way
for simpler cases with no uninstall commands.


 But your package assumes to be run on
 each WPKG run anyway if you specify execute=always, so running it once
 more
 should not be a problem.
 
Can you imagine the frustration that would be caused to you if the cscript
engine decided to 
run a line of code that you'd just removed from wpkg.js for the next run
only :)

Makes things very tricky to debug.

The package I posted here was the simplest package to behave in the way
described.

regards

Simon






-- 
View this message in context: 
http://www.nabble.com/package-is-run-one-more-time-after-removal-tp23834091p23857799.html
Sent from the WPKG - Users mailing list archive at Nabble.com.

-
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] package is run one more time after removal

2009-06-03 Thread Rainer Meier
Hi Simon,

simplesi wrote:
 I believe I published my package in my last post - I think you missed it :)
 It does not have any checks

You're right. Even parts of your response I did not read because it was part of
the quoted text and therefore not obvious that you wrote it.


 The only difference (and that's what is irritating you I think) is that
 WPKG is
 going to verify the package on each run.

 The irritation is that I have removed a package from a profile but WPKG
 thinks it is OK to run the package one more time :)

This is because WPKG first verifies the installed packages which also allows to
repair something which is broken. Also uninstallers require some defined
system state in order to work properly. Therefore this helps to assure that the
system is in a proper state when uninstall commands are run.

Moreover as explained administrators get the chance to fix up wrong commands. If
WPKG would not upgrade to the latest version first it would have to rely on the
commands in local wpkg.xml and if the commands there are wrong the package does
not get removed and you end up in an endless-loop with no chance to fix it
Except re-assigning the package to the host, waiting for execution which does
the update and then remove it again. Unfortunately this approach is totally
inconvenient for administrators because if this happens to a group (profile) of
hosts then it's extremely hard to make sure and track that machines got updated
and then remove the package again.

With the update-before-remove procedure an administrator can simply fix his
mistakes and remove the package. So the host will upgrade and immediately
correctly remove the package.


 I don't call that verification - I call that program execution.

It is verification. It's not the fault of WPKG that you did not specify any
checks which allow WPKG to check if the package is installed properly. If you
add checks, then WPKG does real verification because you enable it to do
verification.

However it seems the only problem you have with the current implementation is
that WPKG will re-run the package (which you flagged with execute=always) once
more right before removing it. The reason why this is a problem is not fully
clear to me because the package will anyway run x times on every client (you
cannot control when and how often the machines are rebooted). Moreover even if
WPKG would not execute it once again it might happen that users are executing it
again right before you publish your profile change.


 I can understand why it has been introduced to deal with debugging faulty
 uninstall scripts but don't see why it cannot behave in a more logical way
 for simpler cases with no uninstall commands.

Because especially in the case where no uninstall commands are defined it's very
likely that the administrator forgot about them and then the
upgrade-before-remove command is very essential.
So just dropping the package in this case will leave the packages installed and
this would for sure yield much more bug reports popping up in our bug tracker.

To me it looks like you use WPKG to run some kind of command on startup.
Choose sounds a bit like an interactive command which is also not a very good
idea to run it via WPKG (which is usually run in background as a service).
However on Windows ME and older this might work.
In any case I would recommend a different approach - you may think about it...
- Install a service which runs your choose commands
- Maintain the service using WPKG
This means that I would create a package which adds the service and verifies
(using checks) that it is installed. If the package is removed WPKG will remove
the service too. Instead of a service you might also use the Autostart, Task
Scheduler, HKLM Run or any other facility.
This way the software you want to invoke is just run as long as the package is
installed. As soon as the package is removed it's not executed any more.



 But your package assumes to be run on
 each WPKG run anyway if you specify execute=always, so running it once
 more
 should not be a problem.

 Can you imagine the frustration that would be caused to you if the cscript
 engine decided to 
 run a line of code that you'd just removed from wpkg.js for the next run
 only :)

This is quite an inappropriate comparison. WPKG is not executing something you
just removed. By removing the profile entry you're just instructing WPKG to
remove the package on next run - it does not specify how this is to be done.
WPKG implements the most safe way to assure proper removal and the behavior of
WPKG to achieve this can be verified within the code by anyone and some
documentation is available too.

So it's not the case that WPKG just executes something unexpected. If the
script engine has a (defined) feature that it reboots the machine when I set
some specific properties, then I can perfectly live with that, even if I did not
ask it to do so because there might be good reason to do so.


 Makes things very tricky to debug.


Re: [wpkg-users] package is run one more time after removal

2009-06-03 Thread Rainer Meier
Hi Simon,

simplesi wrote:
 I am very sorry that you are unable to view WPKG as a tool that is used in
 many different ways.
 
 You seem to think that your way of package deployment is right and that
 other ways are wrong.
 
 This is not good.
 
 I hope that in future, you will listen more to users :)

Thanks for constructive criticism. I know I am totally unable to understand
others needs, that's why nobody wants to use WPKG any more. Well, I have to look
at a little more interests than just yours. WPKG is a nice but small tool which
was made for a specific purpose. If you look for a tool which does basically
everything then we have different views on it.
But hey, the code is open and freely available. So if you have different
priorities than stability and compatibility (which I personally rate very high)
then you're free to change whatever you need.
For example if you want to stop WPKG to verify installed packages you need to
adapt the synchronize() method to your needs. Feel free to provide it to other
users as well and provide support for it too.

I am providing my implementation as well as I spend a lot of time for
free-of-charge support on the mailing list and in turn I take the freedom to
decide what to implement and which changes potentially run WPKG development into
troubles or would lead to an overwhelming amount of support requests.

So feel free to adapt WPKG to do whatever you like to do with it. For me it is
and stays a software deployment tool. It's not an inventory tool and it's not a
tool to run services on a client. For a lot of purposes where WPKG might be
used as well there are perfect mechanisms already available (some of them I
pointed you to already). Personally I prefer to use existing technologies if
they already work well - feel free to re-implement it if you like to.

Of course we are listening to users - but this does not mean that every request
is just patched in without discussing about pro and con. But I realized since
your second message that you already drove the discussion into a dead end by
talking about that the request might be shot down. I still tried to help you
in your use cases and provided lots of input to deal with your issue. But seems
that you want to insist getting a change where I do not agree to. Again, feel
free to change it yourself.

Maybe I am totally wrong and the majority of WPKG users would like WPKG to work
the way you proposed it - unfortunately the discussion was only held between the
 two of us (with one message from Falko).
I am still open to change improvements if I feel they would improve some
situation without major drawbacks. If somebody feels he can drive WPKG to a more
bright future feel free to take over. What I don't like especially is to get
requests which lead to some strong disadvantages (even if the requester cannot
see it yet) and after it would have been implemented the person requesting the
change disappears and users/maintainers have to live with the change.

So I ask WPKG users to give feedback on such requests too and if a majority
thinks I am driving the project into the wrong direction it might be time to
hand over to somebody else.

Awaiting further feedback from the community...

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] package is run one more time after removal

2009-06-02 Thread Rainer Meier
Hi Simon,

simplesi wrote:
 When testing I removed a package from a profile but wpkg seemed to still run
 it the next time i ran my logon script (which does cscript
 %WPKGROOT%\wpkg.js /synchronize )
 
 It them doesn't do run it on subsequent runs.
 
 I'm assuming it looks in wpkg.xml and sees the entry there and decides to
 run it and then deletes it from wpkg.xml afterwards.
 
 Is there a way to stop this happening or is it a bug?
 
 Using WPKG 1.1.0

This might be because of the update-before-remove functionality. In case the
local package (the one which you removed from the profile, but not from the
package database I guess) is outdated then WPKG will first run the latest
install commands as defined within the server database before executing the
remove procedure.

The reason for this is to allow administrators to fix up broken uninstall
procedures in existing packages and therefore allow clients to remove the
packages 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] package is run one more time after removal

2009-06-02 Thread Rainer Meier
Hi Simon,

simplesi wrote:
 In my package files, I NEVER have an uninstall script - I simply use WPKG to
 install and update software.

That's fine with WPKG. In this case during removal simply nothing will be
removed at all (no command executed).

However the issue you face with your packages might come from the fact that you
did not specify appropriate checks for the packages. From your description I
have to assume that you do not specify any checks. As a result the WPKG-internal
isInstalled() check will return false for the package. That means that WPKG will
re-install all these packages having no checks during synchronization.
To prevent this you might specify the execute=once attribute to the package.
Once-Packages are just installed once and then WPKG does not use the checks to
verify if they are installed - WPKG just trusts that they still are.

So in your case WPKG would first check the packages installed and do upgrades of
the ones where upgrades are available (you said you're using WPKG for updates
too). Due to the execute=once flag WPKG would not re-install the packages with
no checks and just trust they are still installed.
The removal procedure would not execute any commands (none specified) and then
WPKG simply assumes the package was removed successfully (isInstalled() returns
false). So exactly what you want to do unless I understood your use-case 
wrongly.


 Could WPKG be modified that if a package has no uninstall script then WPKG
 does not try to do anything except report the information if console
 messages are enabled.

It's already doing this. If there are no uninstall commands WPKG will not do
anything and then use the checks if the package is removed correctly. If you do
not specify any checks this removes the package from local wpkg.xml without
applying any change to the system.

The behavior you're facing comes due to the installPackage() method inside WPKG.
As I wrote above it will re-run the install commands in case you do not specify
any checks (because WPKG has to assume the package is not installed). To prevent
this specify execute=once at the package XML node.

There would still be one case where there could be an upgrade before the removal
commands are run. In case you did an update to the package and then remove it
from a profile. In this case also machines which get the package removed will
first get the upgrade commands run (which should be fine because you're using
WPKG for upgrading anyway and the upgrade should also work for profiles where
the package is still in use) and then the package is removed (in your case
nothing is run because there are no remove commands).


 e.g if there is no uninstall line in the package - then WPKG does not run
 the install/upgrade commands - it just does nothing.

As written above. WPKG is already doing exactly this.
What can go wrong:
- In case you have checks defined then WPKG will not remove the package from
wpkg.xml unless properly uninstalled (checks indicate that the software is not
installed any more). This is very essential to most WPKG users - especially in
corporate environment where you need to make sure that a software to be removed
is really removed (might be license/cost issues).
- If you do not specify any check, then WPKG will re-run the install commands on
each synchronization because it cannot detect if the package is (still) applied
correctly. To tell WPKG not to check each time use the execute=once flag. This
tells WPKG to do a one-shot installation of the package.



 This would let people have the advanced functionality needed to deal with
 complicated uninstall scripts that don't work properly the first time but
 would make WPKG operate in the old simpler way for simple packages. :)

As explained above I think WPKG already supports this use case. So please have a
look at the execute=once flag and try if it fits your needs.

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] package is run one more time after removal

2009-06-02 Thread simplesi


Rainer Meier wrote:
 
 However the issue you face with your packages might come from the fact
 that you
 did not specify appropriate checks for the packages. From your description
 I
 have to assume that you do not specify any checks. As a result the
 WPKG-internal
 isInstalled() check will return false for the package. That means that
 WPKG will
 re-install all these packages having no checks during synchronization.
 To prevent this you might specify the execute=once attribute to the
 package.
 Once-Packages are just installed once and then WPKG does not use the
 checks to
 verify if they are installed - WPKG just trusts that they still are.

This package is a execute=always, as it is a script to be run if the
computer is connected to the school network and not run if the computer is
not connected (e.g laptop at home) and the computer can't reach the school
server over a LAN.

I think it is incorrect logic for a package to be run if it is not in the
profile of the designated host.

I don't think it used to work that way and it seems to have been introduced
as a work-around for uninstall issues.

This behaviour was very confusing when I was testing the package until I
realised what was happening.


 Could WPKG be modified that if a package has no uninstall script then
 WPKG
 does not try to do anything except report the information if console
 messages are enabled.
 
 It's already doing this. If there are no uninstall commands WPKG will not
 do
 anything and then use the checks if the package is removed correctly. If
 you do
 not specify any checks this removes the package from local wpkg.xml
 without
 applying any change to the system.

No - what I mean is not do anything at all (apart from send/log message) -
No uninstall - WPKG does nothing - doesn't run package one more time -
doesn't remove wpkg.xml entry.




 e.g if there is no uninstall line in the package - then WPKG does not run
 the install/upgrade commands - it just does nothing.
 
 As written above. WPKG is already doing exactly this.

It is not doing nothing - it is running the package one more time :)

What I am trying to say is that WPKG has some very complex logic to deal
with possible problems with uninstallin software but is failing to deal with
simple issues that do not have have these possible problems :)

So, I'm suggesting that it be modified to retain all the extra coding added
to deal with complex issues but this extra code should be bypassed (or a
switch /simple :) added so that WPKG can operate at a simpler and more
intuitive level :)


regards

Simon

Just to give the big picture again, I use WPKG at several schools and I've
been using the 0.9 series for years - I'd like to move onto the recent
versions  - mainly for using separate package files (so I can just copy them
from one school to another) and for the dependancy enhancements.

I think it is great that WPKG can now deal with complex uninstall problems
(and I might need them one day) but I'd like the simple folk like me not be
be left behind :)

-- 
View this message in context: 
http://www.nabble.com/package-is-run-one-more-time-after-removal-tp23834091p23842087.html
Sent from the WPKG - Users mailing list archive at Nabble.com.

-
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