Re: [Apcupsd-users] Re: Win32 apcupsd
Brought to you by:
adk0212
From: Kern S. <ke...@si...> - 2005-11-27 16:49:42
|
On Sunday 27 November 2005 14:59, Adam Kropelin wrote: > Kern Sibbald wrote: > > On Sunday 27 November 2005 01:36, Adam Kropelin wrote: > >> Here's a better description of what's happening. On Win XP, during > >> installation I am prompted whether apcupsd should be installed as a > >> service. If I answer "yes", the normal message box stating "The > >> apcupsd service was successfully installed..." is followed by a > >> second message box containing the text... > >> "c:\apcupsd\bin\apcupsd.exe" /service > >> I'm not sure what is responsible for displaying the second message > >> box, but it probably is unnecessary. > > > > This is normal, providing the second message box goes away. This > > second box is a stupid Microsoft DOS box put up my Microsoft. It > > gets displayed when the script exec()s the "net start apcupsd" > > command, and I have found no way to avoid it. If you have any ideas, > > great. On my machine it generally happens so fast that I cannot read > > the contents of the box. > > What I'm seein is a real GUI message box that requires me to click OK, > not a DOS box. (The DOS box does fly by too fast read.) The message box > can be seen in this screenshot: > http://www.kroptech.com/~adk0212/apcupsd/messagebox.JPG > This only happens on WinXP, not Win98. Thanks for the picture -- it was really worth a 1000 words. It turns out (I didn't remember) that a program that is installing itself as a service cannot display message boxes on XP and up until the service is installed (and has said that it should interact with the desktop), while Win98 can. So you were seeing some debug output, which I deleted. I also found the other dialog box that asks you to click on the Start icon. This was there for users installing with the tar file, along with the message saying to reboot. Now the problem is that I can remove that but anyone not using the installer will be a bit confused. I guess I'll #ifdef it off and we will see what happens. I cannot imagine anyone installing with tar once the installer is available. > > >> One other installation glitch I noticed when testing on Win98 > >> (instead of XP). After the service is installed, as message box > >> appears saying, among other things, that to start the service I can > >> reboot or "double click the start icon". There is no start icon so > >> perhaps that bit of text needs to go away. Rebooting appears to be > >> the only choice, outside of manually invoking "apcupsd /service" > > > > It should have created an apcupsd start icon, which will be on your > > desktop. > > No such icon was created. As a side comment, would the start shortcut be > better placed in the start menu under the apcupsd folder? I made my own > shortcuts there to "c:\apcupsd\apcupsd\bin\apcupsd.exe /service" and > "c:\apcupsd\apcupsd\bin\apcupsd.exe /kill" which seem to be very > convenient. It's something of a personal issue I guess...I'm against > desktop clutter when possible. Actually, they are placed on the main Programs menu under Apcupsd. On WinXP and up there should only be the uninstall link. If we want to distribute the pdf, I can also add a pdf link. Putting the uninstall under the Programs->Start menu would seem a bit odd to me. I don't think there are any links defined except those in the /apcupsd directory for starting and stopping apcupsd, because on WinXP systems and up, you must either use the "net" command or better yet the Component Services ... I'll be happy to change the current location of what is created, but if you want a different behavior for Win98, I'll leave that programming task to someone else. I have no Win98 systems here ... :-) > > >> Uninstall seems to be working much better now, aside from one big > >> issue and one small issue: > >> - Big issue: If you have an existing cygwin installation and follow > >> the directions to enter your cygwin root directory as the > >> installation path, your entire cygwin /bin directory will be deleted > >> when apcupsd is uninstalled. :) > > > > Oh, a small little bug that is rather catastrophic ... I'll fix that > > right away ... Thanks for noticing it. > > > >> In my case, my cygwin root is d:\cygwin so I installed > >> apcupsd there which put apcupsd.exe and friends in d:\cygwin\bin > >> along side all my other cygwin tools. So far so good. Uninstalling > >> apcupsd deleted the entire d:\cygwin\bin directory, not just the > >> apcupsd executables. > > > > I need to look at this and think about it. I suppose the simplest is > > to only delete the binaries we installed. The problem is that we > > install a good number of cygwin binaries, so probably we need to tell > > the user that he *must* install into a different directory. > > Yes, I think our policy should be that users having cygwin should NOT > use the installer but rather build apcupsd from source and install the > traditional unix way (provided that 'make install' works as expected > under cygwin). If they have cygwin, chances are good that they are a > developer and running configure and make is not too much to ask. Well, I would prefer not to have restrictions. If you want to make that a suggestion OK, but I see no reason not to go ahead and install it. If there is a conflict of dlls the user will find out pretty fast. > > >> - Small issue: During uninstall on WinXP I was asked if I would like > >> to delete configuration and state files. I answered "yes", but > >> apcupsd.conf and apccontrol were still left behind. In fact I can't > >> find any different result between answering "yes" and "no" to that > >> prompt. > > > > The code has a difference, but I guess there are a few lingering > > files in the directory which prevent removing it. Windows doesn't > > seem to have a rm -rf /dir command. > > Unfortunately there isn't a universal command that will work. On > WinXP/2000 "rd /q /s" will do the job, but those switches don't exist on > the Win98 version of 'rd'. OK, thanks. I just delete everything I install, and if the directory doesn't go away, the user has added a file, and he/she can worry about it. The ugly part is remembering to properly update the installer deinstall routines when you add a new file -- too bad this isn't more rpm like. I'll have a corrected version shortly. -- Best regards, Kern ("> /\ V_V |