epoch1970;434787 Wrote:
> Late reply, sorry.
>
> I'd remove completely the link. Using the "Reset to defaults" link
> could make it appear again, until the install checker is executed
> again.
>
> BTW, since SCPowerTool can be anywhere, why not in the location you
> mandate for it?
There is no mandate for a location for SCPowerTool.exe..it can be
anywhere on the PATH.
With the next release, I think I will try to detect if setup has been
run, and, if it has, make the help link small and move it to the bottom
of the page. Removing it all-together implies that can I be
__absolutely__ certain that setup has been run. But, in fact, I think I
can only be -reasonably- certain.
The 'HasBeenSetup' logic will go something like this:
Code:
--------------------
#Are we running windows?
if ($g{szOS} eq 'win') {
$szCheckFile = "SCPowerTool.exe";
#http://search.cpan.org/~clive/Win32-SearchPath-0.03/SearchPath.pm
#search the system PATH for the exe file..
$szCheckFile = Win32::SearchPath( $szCheckFile );
if (-e $szCheckFile) {
#Move the further setup help link to the bottom of the page..
} else {
#establish the setup link at the top of the page..
}
## Various linux distros & OSX..
} elsif ( $g{szOS} eq 'unix' || $g{szOS} eq 'mac' ) {
$szCheckFile = "/usr/local/sbin/spc-wakeup.sh";
if (-e $szCheckFile) {
#Move the further setup help link to the bottom of the page..
} else {
#establish the setup link at the top of the page..
}
} else {
#Provide generic instructions..
}
--------------------
With linux and OSX, this is just 'reasonable certainty' because we
really can't see into /etc/sudoers without running sudo..i.e. a catch22.
I suppose I could try running:
sudo /sbin/shutdown -h -k now
..which is a "fake" shutdown request. If sudo returns 0, then there
hasn't been a permissions problem...and thus I know that /etc/sudoers
has been correctly configured. However, if there is a permission
problem, I suspect that my 'HasBeenSetup' code will be blocked until
sudo times-out waiting for a password. And that would be really, really
bad: having the settings page blocked from opening for 5 minutes, the
default sudo timeout period.
--
gharris999
------------------------------------------------------------------------
gharris999's Profile: http://forums.slimdevices.com/member.php?userid=115
View this thread: http://forums.slimdevices.com/showthread.php?t=48521
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins