Page 1 of 1
Any PB command that set "request admin mode" automatically
Posted: Tue Aug 19, 2014 3:21 am
by viiartz
Hi All,
Is there any PB command that set, when saved as an executable (EXE), the "request admin mode" even though I have not set that option in the project settings?
(PB 5.30 Win x86, jaPBe 3.13.4.880, Win 7 x86)
Re: Any PB command that set "request admin mode" automatical
Posted: Tue Aug 19, 2014 9:24 am
by Fred
No, it's set trough the manifest file, it's not command related.
Re: Any PB command that set "request admin mode" automatical
Posted: Tue Aug 19, 2014 12:24 pm
by viiartz
So, any reason why this would be happening then?
Re: Any PB command that set "request admin mode" automatical
Posted: Tue Aug 19, 2014 12:26 pm
by Fred
No, I don't know. I see you use JaPBe, may be a bug ?
Re: Any PB command that set "request admin mode" automatical
Posted: Tue Aug 19, 2014 2:07 pm
by viiartz
Fred wrote:No, I don't know. I see you use JaPBe, may be a bug ?
I'm not so sure, I get the same issue with the PB editor as well! Anyway I poster the code below just in case you see something I don't!
Code: Select all
Global NewList WhiteList.S()
Global NewList BouncedList.S()
Global InputFile$ =""
Enumeration
#BouncedList
#WhiteList
#NewWhiteList
EndEnumeration
Procedure.S OpenInputFile(title.S="Choose a file to open")
StandardFile$ = "\" ; set initial file+path to display
Pattern$ = "Text (*.txt)|*.txt|All files (*.*)|*.*"
Pattern = 0 ; use the first of the three possible patterns as standard
File$ = OpenFileRequester(title, StandardFile$, Pattern$, Pattern)
If File$
ProcedureReturn File$
Else
Debug "No file selected, ending program!"
End
EndIf
EndProcedure
Procedure FindBouncedInWhiteList()
;CallDebugger
ForEach WhiteList()
ForEach BouncedList()
;Debug "D: "+BouncedList()
;Debug "W: "+WhiteList()
If FindString(WhiteList(),BouncedList())<>0
;CallDebugger
; If FindString(WhiteList(),"*?*")=0
; WhiteList() = "*?*"+WhiteList()+"*?*"
; EndIf
DeleteElement(WhiteList(),1)
EndIf
Next
Next
EndProcedure
Procedure LoadList()
If ReadFile(#WhiteList,OpenInputFile("White List"))
While Eof(#WhiteList)=0
If AddElement(WhiteList())
WhiteList() = ReadString(#WhiteList)
EndIf
Wend
EndIf
CloseFile(#WhiteList)
If ReadFile(#BouncedList,OpenInputFile("Bounced List"))
While Eof(#BouncedList)=0
If AddElement(BouncedList())
BouncedList() = ReadString(#BouncedList)
EndIf
Wend
EndIf
CloseFile(#BouncedList)
EndProcedure
; Procedure DisplayList()
; Count=0
; SortList(WhiteList(),#PB_Sort_Ascending)
; ForEach WhiteList()
; Debug FormatI(Count,"[###]")+" "+WhiteList()
; Count+1
; Next
; EndProcedure
Procedure.S GetMyPath()
ProcedureReturn GetPathPart(ProgramFilename())
EndProcedure
Procedure SaveNewWhiteList()
;CallDebugger
asat$="_asat_"+ FormatDate("%dd-%mm-%yyyy",Date())
SaveFilePath$=GetMyPath()+"EmailList"+asat$+".txt"
If CreateFile(#NewWhiteList,SaveFilePath$)
ForEach WhiteList()
WriteStringN(#NewWhiteList,WhiteList())
Next
EndIf
CloseFile(#NewWhiteList)
MessageRequester("Save List","New Email list was saved: "+SaveFilePath$)
EndProcedure
;- Main
;CallDebugger
LoadList()
;CallDebugger
FindBouncedInWhiteList()
SaveNewWhiteList()
;CallDebugger
; IDE Options = PureBasic 5.30 (Windows - x86)
; Folding = ---
; EnableUnicode
; EnableXP
; Executable = EmailListUpdate.exe
Re: Any PB command that set "request admin mode" automatical
Posted: Tue Aug 19, 2014 5:41 pm
by p2hicy
Windows heuristics sees the 'update' part in your executable name and automatically elevates it. You can turn it off in the compiler options by enabling "Request User mode for Windows Vista and above (no virtualisation)".
Source:
http://technet.microsoft.com/en-us/libr ... 10%29.aspx
Re: Any PB command that set "request admin mode" automatical
Posted: Tue Aug 19, 2014 7:19 pm
by viiartz
p2hicy wrote:Windows heuristics sees the 'update' part in your executable name and automatically elevates it. You can turn it off in the compiler options by enabling "Request User mode for Windows Vista and above (no virtualisation)".
Source:
http://technet.microsoft.com/en-us/libr ... 10%29.aspx
Yep, that's what it was!
Thank so much for unravelling the mystery, Finally!