I would like to have Vista/UAC pop up errors
instead of silently redirecting file paths if user and/or
program tries to save a file in a no-access area.
Anyway guidance on how to best have this?
best regadrs
Thomas Schulz
> I would like to have Vista/UAC pop up errors
> instead of silently redirecting file paths if user and/or
> program tries to save a file in a no-access area.
Try going into your Project Options and set the Application|Use Runtime
Themes. This will change the ShowMessage dialogs and MessageDlg will
show the Vista version. For the special vista task dialog you will
need to use the Vista Dialogs afaik.
Also, with this setting on, you will not get virtualized so write
attempts at HKLM will fail as well as writes to "Program Files". Not
sure if this is what you are looking for.
--
<?xml version="1.0" encoding="utf-8" ?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0"
processorArchitecture="X86"
name="Vista UAC Compat.Application"
type="win32" />
<description>WindowsVistaReadiness Application</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
I put this into "vista.bin" and create "Vista.rc" with the only line "1 24
"Vista.bin"", compile this file into "vista.res" using brcc32.exe and
include the line "{$R vista.res}" in my project.
Regards Henrik
I though runtime themes was about being able to
switch mainifests placed in application directory
while program was running?
I must have read that wrong.
> Also, with this setting on, you will not get virtualized so write
> attempts at HKLM will fail as well as writes to "Program Files". Not
> sure if this is what you are looking for.
Close... never want virtualization! Ever! :-)
In case of administator-rights needed I want:
UAC dialog ask user and if "no"... Get error/fail access!
best regards
Thomas Schulz
Well, the program can run under limited accounts
(as tested on WinXP). I am more worried about subtle
bugs where files silently are stored the wrong places.
I do not have Vista myself yet so I am not 100% sure
of the implications, but generally I will prefer getting
error messages and WinXP'ish "limited user" behavior.
best regards
Thomas Schulz
> Well, the program can run under limited accounts
> (as tested on WinXP). I am more worried about subtle
> bugs where files silently are stored the wrong places.
I can understand this. Its tough getting used to hunting down the
location of a file written by a non-UAC aware app. Add to that running
under Vista x64 which added another layer of "virtualization" for 32 vs
64 bit apps, its always a joy to try and find where files get stored.
--
Then I believe you should use <requestedExecutionLevel level="asInvoker"/>
in your manifest.
This will cause the application not to be virtualized and still run as the
user who launched it.
If I understand it correctly, virtualization is a backward-compatibility
feature used with older applications which come without a
requestedExecutionLevel manifest.
Here's a help file with more information about Vista UAC:
http://download.microsoft.com/download/d/9/b/d9beb875-bc1d-4338-a655-251f4f353b2e/top10wave.exe
HTH
TOndrej