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 / user account control

Author
Message
basjak
16
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 14th Apr 2011 14:48
I am making a download software. everything is fine when user account control(UAC) is switched off. even the software that is downloaded will not work if UAC is switched on because it relies on a file that will be hidden in a folder in program files.

now, I cannot tell my customers to switch off UAC every time they use my software then switched back on at the time they have finished playing.

any help?
mr_d
DBPro Tool Maker
19
Years of Service
User Offline
Joined: 26th Mar 2007
Location: Somewhere In Australia
Posted: 14th Apr 2011 15:00 Edited at: 14th Apr 2011 15:04
ummmmmm, don't hide the file in the program files folder????

i'm not positive i understood what you were trying to get across, so the above suggestion is half tongue-in-cheek.

seriously though, (again if i understand your problem properly), I have found that executable files downloaded directly from the internet are modified by Windows slightly and are given a special attribute that indicates this fact, and so attempts to run the file will cause UAC to do it's stupid job.

with some files, you can right-click and get properties of the file and then use the "unblock" function to clear this attribute/flag, but with others this isn't possible (don't know why). my solution to this was to package my program in a self-extracting zip file. when this was run and the real program extracted, it would not have that special attribute set, so would not trigger UAC. If you package your program using any of the popular installers, then this should work for you as well.

An alternative that should also work (but one that I haven't tried myself) would be to modify the file extension of your download file and the first 2 bytes of the file (which are always "MZ" for exe files), and then to reverse this after the file has been downloaded. Hope this helps, Good Luck!

Benjamin
23
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 14th Apr 2011 15:58
If you need your program to store data in files you should be storing them under the user directory instead of program files (which is now considered a protected directory).



Support a charitable indie game project!
basjak
16
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 14th Apr 2011 16:10
we always see software(s) downloaded into program files so there must be something we can break.
Wyldhunt
16
Years of Service
User Offline
Joined: 27th Sep 2009
Location: The Dark Side
Posted: 14th Apr 2011 16:53
UAC specifically prevents files in the program folders from being modified in any way. A program can generally run from the program files directory just fine as long as it never saves/creates/modifies any other file in the program folders.
Most programs that were not specifically designed for Win7 must be either run as an administrator or have UAC turned off.

The way new programs that are designed for Win7 get around this is to have the static executables install in to the programs folder. Then, create a new sub folder in the user folder which holds any non-static files. You'll find that this is how anything from Poser to 3ds Max to anything created by Adobe all get around UAC.
If your hidden file is triggering UAC, it is probably because it is not a static file and should be placed elsewhere.

Login to post a reply

Server time is: 2026-07-18 14:27:07
Your offset time is: 2026-07-18 14:27:07