[wpkg-users] Notify in wpkg.js [SEC=UNCLASSIFIED]
Michael Chinn
m.chinn at gbrmpa.gov.au
Mon Apr 16 08:34:07 CEST 2007
Ive come across a situation where a package required users to be alerted
that it was being installed, however when I go to use the wpkg notify
system I noticed that it uses net send. On workstation the alerter
service is disabled, I think this is why it is failing.
Would it be better to use the WSH Object Popup?
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/f482c739-3cf9-4139-a6af-3bde299b8009.asp
starts ~ line 2340
/**
* Notifies the user/computer with a pop up message.
*/
function notify(message) {
if (!nonotify) {
var cmd = "";
cmd += "%SystemRoot%\\System32\\NET.EXE SEND ";
cmd += host;
cmd += " \"" + message + "\"";
try {
exec(cmd, 0);
} catch (e) {
throw new Error(0, "Notification failed. " + e.description);
}
} else {
info("User notification suppressed.");
}
}
could be something like
var wshObject = WScript.CreateObject("WScript.Shell");
var intButton = wshObject.Popup("\" + message + "\", 10, "Alert", 52**);
WScript.Echo(intButton);
sorry not much of a scripter otherwise I could polish it up.
**This would also allow users to choose whether to install that package
during that boot and return what the user chose. It also has a timeout
if no button is pressed (10sec)
--
Michael Chinn
User Support Officer - Information Technology
Great Barrier Reef Marine Park Authority
PO Box 1379
TOWNSVILLE, QLD 4810
Ph 07 47500874 Fax 07 4772 6093
michaelc at gbrmpa.gov.au
================================================================================
If you have received this transmission in error please notify us immediately
by return email and delete all copies. Any unauthorised use, disclosure or
distribution of this email is prohibited.
================================================================================
wpkg-users mailing list
wpkg-users at lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/wpkg-users
More information about the wpkg-users
mailing list