I recently started to use STAX to create a series of scripts that will install some software on a user's PC and was shocked to discover that a pretty decent percentage of people don't change their User Account Control settings in Windows 7 to "Never notify." (You can access this by going to the Control Panel, User Accounts and Family Safety, User Accounts, and clicking "Change User Account Control settings.") This causes those annoying Confirm/Deny popups when STAX tries to run the respective product installers (or when a user installs anything manually), and the STAX Monitor will even hang until the user responds to the dialog box.
Do the trust levels in the STAF.cfg file not handle this? When running a <process> and command mode is set to "shell" this means that the resulting cmd.exe that spawns does not run with administrative privileges, yes? So far the only way I have found to get around this is to run commands in a wrapper script that elevates the resulting cmd.exe to have administrative privileges, but I'd prefer to not bypass security measures this way since at some point Microsoft will probably release an update to block this type of script behavior. Also, asking users to change the UAC settings has other side effects where it can alter user preferences of already installed and running applications.
STAF trust levels have nothing to do with Windows UAC security.
If you want to run a process via the STAF PROCESS START request (which is what a <process> element in a STAX job does) and not get UAC prompts, you may need to run STAFProc as an administrator. See section "5.1.2 Running STAFProc on Windows Vista and Windows Server 2008 and later" in the STAF User's Guide at http://staf.sourceforge.net/current/STAFUG.htm#HDRSTPROC for more information on how to do this.
How does this affect STAX? When I try and start the monitor after starting STAFProc.exe as an administrator I get the following output, even though I can see STAF running:
C:\STAF\services\stax>java -jar STAXMon.jar
STAX Job Monitor V3.4.5 requires STAF V3.3.3 or later to be running
Looks like I have to start the command prompt as an admin to run the java command otherwise it won't be able to find the process…
It appears you are running a version of the STAX Monitor (V3.4.5) that requires STAF V3.3.3 or later to be running (just like the message says). This doesn't have anything to do with running STAFProc as an administrator.
I have STAF 3.4.5. When I change the STAFProc.exe to run as administrator, the STAX Monitor (v 3.4.5) gives this output when I try and start it from a command prompt that has not been started via the "Run as administrator" option. If I open the command prompt via "Run as administrator" then start the STAX Monitor via java -jar STAXMon.jar runs fine. It seems that however they were started, both need to be in sync with one another, and conversely when I remove the admin privileges from STAFProc.exe starting the STAX Monitor via a regular command prompt works fine.
Oh, I didn't realize you weren't running the STAX Monitor as an administrator as well. Yes, this is documented in section "5.1.2 Running STAFProc on Windows Vista and Windows Server 2008 and later" in the STAF User's Guide at http://staf.sourceforge.net/current/STAFUG.htm#HDRSTPROC where it says:
"Note: When STAFProc.exe is run as an administrator, you must also run STAF.exe as an administrator if you want to submit local STAF requests from a command prompt on the local Windows Vista machine. "
Since the STAX Monitor Java application is submitting local STAF requests, it applies as well to it.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.