Page 1 of 1

[DONE] Administrator mode for Vista

Posted: Tue Sep 16, 2008 4:24 pm
by ts-soft
can you add the manifest for "Request Administrator mode for Windows Vista", please
Without this i can tailbite only using if i start the PB-IDE with admin-privileges.

greetings
Thomas

Posted: Wed Sep 17, 2008 6:33 pm
by ABBKlaus
normally this would be the case :?
I compiled with the newest beta 4.30 Beta 1 but unfortunately i just returned my new Vista System (Quadcore-CPU+Mainboard) to ALTERNATE.

I will test this asap :wink:

Regards Klaus


TailBite Installer Build.pb :

Code: Select all

PBCompile(SrcDirName$+"TBUpdater.pb", SrcDirName$+"TBUpdater.exe", " /ADMINISTRATOR /XP", 0, "", 1)
PBCompile(SrcDirName$+"TBManager.pb", DirName$+"TBManager.exe", " /ADMINISTRATOR /XP", 1, "", 1)
PBCompile(SrcDirName$+"TailBite.pb", DirName$+"TailBite.exe", " /ADMINISTRATOR /XP", 1, "", 1)

Posted: Wed Sep 17, 2008 8:16 pm
by ABBKlaus
Did you modified the user privileges on the PureBasic installation directory ?
If that´s the case TailBite won´t ask for Admin-Privileges.

Posted: Wed Sep 17, 2008 9:17 pm
by ts-soft
ABBKlaus wrote:Did you modified the user privileges on the PureBasic installation directory ?
I have nothing changed
ABBKlaus wrote: If that´s the case TailBite won´t ask for Admin-Privileges.
I start tailbite normal from the ide, but it doesn't do anything. If i start the
ide with admin priviliges (right click: as admin), so tailbite works normal,
without prompting.
I have test tailbite direct, it prompts by directclick :o
My pbinstallation is in "Program Files (x86)" and tailbite is a subdir ob pb

greetings
thomas

Posted: Thu Sep 18, 2008 7:18 pm
by ABBKlaus
Thomas can you test this :

Code: Select all

Procedure.s GetLastError()
  err=GetLastError_()
  buffer.l=0
  ferr=FormatMessage_(#FORMAT_MESSAGE_ALLOCATE_BUFFER|#FORMAT_MESSAGE_FROM_SYSTEM,0,err,GetUserDefaultLangID_(),@buffer,0,0)
  If buffer<>0
    errormsg$=PeekS(buffer)
    LocalFree_(buffer)
    ProcedureReturn RemoveString(errormsg$,Chr(13)+Chr(10))
  EndIf
EndProcedure

ApplicationName$="C:\Program files\TailBite\TailBite.exe"
;ApplicationName$="C:\Windows\notepad.exe"
Verb$="";runas
Dir$=GetCurrentDirectory()

#Test=0 ; 0=Test RunProgram / 1=Test ShellExecuteEx_()
CompilerIf #Test=0
  Res=RunProgram(ApplicationName$)
  If Res=0
    MessageRequester("RunProgram()",GetLastError())
  EndIf
CompilerElse
  si.SHELLEXECUTEINFO
  si\cbSize=SizeOf(SHELLEXECUTEINFO)
  si\fMask=0
  si\hwnd=0;-1 <- use this value to see the bug !
  si\lpVerb=0;@Verb$
  si\lpFile=@ApplicationName$
  si\lpDirectory=@Dir$
  si\nShow=0
  
  Res=ShellExecuteEx_(si)
  If Res=0
    MessageRequester("ShellExecuteEx_()",GetLastError())
  EndIf
CompilerEndIf
I think the bug is in runprogram !

The parameter for hwnd is not set correctly, at least i get the UAC warning but not maximised :?

Image

Posted: Thu Sep 18, 2008 9:25 pm
by ts-soft

Code: Select all

#Test=0
Message wrote:---------------------------
RunProgram()
---------------------------
Ungültiges Fensterhandle
---------------------------
OK
---------------------------

Code: Select all

#Test=1
Message wrote:---------------------------
TailBite
---------------------------
Anwendung:
TailBite.exe <Quelldatei.pb> </Optionen>
TailBite Manager starten?
---------------------------
Ja Nein
---------------------------
With Shellexecute comes the UAC prompt!

Posted: Wed Sep 24, 2008 3:18 pm
by ABBKlaus
@ts-soft : it´s fixed in Beta 2, can you confirm ?

Posted: Wed Sep 24, 2008 3:34 pm
by ts-soft
ABBKlaus wrote:@ts-soft : it´s fixed in Beta 2, can you confirm ?
i can, confimed!