Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / "Run as Administrator"

Author
Message
GIDustin
18
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 2nd Jan 2012 20:16
I made an auto-updater for my game, and it writes directly to the program files directory. With Windows Vista/7, this needs to be run as admin or it will fail when it tries to open files to write them.

How can I get my program to ask for admin privileges before it is run? Every website I have been to says I might need to make a manifest?
Benjamin
23
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 2nd Jan 2012 20:44 Edited at: 2nd Jan 2012 20:44
I was going to first suggest that you don't write directly to the program files directory since on Vista/7 this is considered bad practice, but in the case of updating executable files it's fine.

Take a look at this link. The article itself is a bit lengthy but it should give you all the information you need.



Support a charitable indie game project!
GIDustin
18
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 2nd Jan 2012 20:59
I read that and didn't get much out of it. Most of the guides online are for Visual Basic/C, not DBPro.

I did find an article here and followed it. My application now asks for admin rights when run, but that is it. The "mt.exe" replaced my 8MB exe with a 500kb exe that asks for Admin rights, and then closes....
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 3rd Jan 2012 14:18
I would have thought the old school method of a READ ME would suffice

bitJericho
23
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 3rd Jan 2012 14:35
i don't know if this would work, but you could try to create a batch file that uses the runas command as described in the doc ben linked to.


GIDustin
18
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 3rd Jan 2012 15:10
I did end up finding a solution. I downloaded the trial of ResTuner. With that I was able to open the EXE, open the manifest, and change it to require administrator.

Login to post a reply

Server time is: 2026-07-10 13:45:10
Your offset time is: 2026-07-10 13:45:10