2013-04-18, 18:02
(2013-04-15, 16:54)baijuxavior Wrote:(2013-04-15, 11:01)anarchoi Wrote: 1. XBMCLauncher autoruns with windows 8 so i don't think i can make it start automatically in administrator mode
2. i don't know how to edit the source code and recompilate it is it possible to release a compiled version of XBMCLauncher with admin mode on ?
Thanks a lot
Editing and compiling .ahk file is very easy. Download and install autohotkey_l from the link provided in the first page. Download the source code and extract using winrar. Open the xbmclauncher.ahk file in notepad. Notepad++ is recommended. Change the code
withCode:LaunchApplication(AppPath) ; function to start applications
{
SplitPath, AppPath, FileName ;get filename without path
Process, Exist, %FileName% ; check to see if 'FileName' is running
If (ErrorLevel = 0) ;if not running
{
if FileExist(AppPath)
{
if (FileName = "XBMC.exe" and StartPortable = 1)
run %AppPath% -p
else
run %AppPath%
}
Else
{
;traytip, Message, %AppPath% not found, 5, 1
}
}
Else ; file already running
{
;traytip, Message, %FileName% already running, 5, 1
}
}
Code:LaunchApplication(AppPath) ; function to start applications
{
SplitPath, AppPath, FileName ;get filename without path
Process, Exist, %FileName% ; check to see if 'FileName' is running
If (ErrorLevel = 0) ;if not running
{
if FileExist(AppPath)
{
if (FileName = "XBMC.exe" and StartPortable = 1)
{RunAs, Administrator, YourPassword
run %AppPath% -p
RunAs
}
else
{RunAs, Administrator, YourPassword
run %AppPath%
RunAs
}
}
Else
{
;traytip, Message, %AppPath% not found, 5, 1
}
}
Else ; file already running
{
;traytip, Message, %FileName% already running, 5, 1
}
}
After making the necessary changes, save the file. Then right click the .ahk file and select the option 'compile' which will create XNMCLauncher.exe in the same location. Replace the existing .exe file in program folder using this new one.
Please note, I have not tested this method. But it should work as given in the autohotkey help page. If no luck, let me know, I will upload the code to pastebin so that you can copy paste it.
After doing this, i get this error when running the exe
"Error: Launch Error (possibly related to RunAs)
Specifically: Incorrect username or password
Line # 567 Run,%Apppath%"