1
Vote

Feature request

description

Hi, I love this project!

I would like to request a few features though (that would make this a lot more usable)
  1. Possible in XML to spesify "start in directory" (the directory that will be the applications current working directory)
  2. Possible to specify parameters to application.
  3. True/False variable; restart if application closed by user.
I'm currently in the process of writing a "SCCM 2012 LogonScreen Install Status" app. This project makes that job a whole lot easier.


Best regards
T_Bear

file attachments

comments

sw3103 wrote Jun 6, 2013 at 3:41 PM

Hi T_Bear,

Thanks for your comments and feedback.

The WinAPI function required to launch the process in the Logon Screen desktop does not support working directories or command line arguments.

Your best bet would be to write a wrapper for your application (which looks very nice, BTW). Have LSL launch the wrapper, which could set the working directory, pass command line arguments, and even re-launch the application if it is closed be the user (which you could also try to mitigate by not having a close option, although it won't stop an Alt+F4).

Happy to help you out with any of these suggestions if required.

Thanks,

sw3103

T_Bear_Skistad wrote Jun 11, 2013 at 6:32 AM

I wrote a laucher (in autoit) a while back that from a service lauches stuff on the users desktop.


I got pieces of code from here and there, mainly from this guy:
;http://www.autoitscript.com/forum/topic/104735-elevate-your-script-to-the-system-account/page__hl__systemelevate

Lots of ugly code, but basically does a dll call like this:
.....
Global $ghADVAPI32 = DllOpen("advapi32.dll") ;needed in the elevateandrun + getenvironmentwork
......
Local $hDupToken = DllCall($ghADVAPI32, "int", "DuplicateTokenEx", "ptr", $hToken, "dword", $MAXIMUM_ALLOWED, "ptr", 0, "int",$SecurityIdentification, "int", $TokenPrimary, "ptr*", 0)

.... lots of error checking and stuff...

$ret = DllCall($ghADVAPI32, "int", "CreateProcessAsUserW", "ptr", $hDupToken, "ptr", 0, "wstr", $sAppPath, "ptr", 0, "ptr", 0, "int", 0, "dword", $dwCreationFlags, "ptr", $pEnvBlock, "ptr", 0, "ptr", DllStructGetPtr($SI), "ptr", DllStructGetPtr($PI))
This code does not set the working directory, but does take command line options.
The $sAppPath is the full path to the executable with command line parameters
The $PI is a way to keep track of the process after beeing launched, thus knowing when it ends. (to get exitcode in my situation)

If this can be helpful in anyway, I can send you the entire autoit code.

sw3103 wrote Jun 13, 2013 at 4:10 PM

Are you able to write something in .NET?

What did you use for the RunningJob application?