Win7 and vista permission problems
Hello guys,
I recently developed an app in vb6 that has to modify some system file for it to function properly eg host.
Even when running in in admin user account, "not the default administrator", permission to that file is locked or the file is readonly.
Unless the program is run in the default administrator account, then the file is locked. teh program works well in winxp, except vista and win7
what do i do now, as i need a way to add dns record to the host file without running as administrator account
Re: Win7 and vista permission problems
In Vista and Win 7 you have to run as "Administrator" by right clicking your application and selecting to run as "Administrator". Though if the user is mentioned as the "Administrator" it is not so. And moreover no vb6 application will run on win7 and vista. Better always use WinXP.
Re: Win7 and vista permission problems
The first half of that reply is correct, but I'm afraid that this part is very wrong:
Quote:
And moreover no vb6 application will run on win7 and vista. Better always use WinXP.
In most cases VB6 applications work perfectly on Vista/7 with no changes at all, or just the same changes needed for XP and 2000 to allow non-admin users to be able to run them (such as this particular issue).
In fact generally Vista/7 require fewer code changes than XP/2000 for a non-admin, due to features such as virtualisation automatically fixing your mistakes to some degree.
Re: Win7 and vista permission problems
Oops sorry i had used a wrong word saying that the VB6 application wont work in win7 and vista.
What i had meant is if any code has to be done using vb6 in win7 and vista, it is not so easily possible.
This is what i tried to mean.
Sorry for my wordings.
Thanks for pointing it out.
Re: Win7 and vista permission problems
thanks for response
instead of rightclicking, is there a way to force the app to require administrator privileged before starting?
The app is installed and run under admin account
Re: Win7 and vista permission problems
You can manifest it to do that. It has been asked before, try doing a few Searches on the forum.
Re: Win7 and vista permission problems
i found some code that requires attaching manifest to my app.
vb Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="MyApp" type="win32"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
I have not tested it yet, but in case it works, the problem is that i already manifest for xp styles. is there a way i cam merge the two manifest, or i only need to change some parameters
optionally, where can i get detailed information about manifest and vb
Re: Win7 and vista permission problems
Manifest files are not specific to VB (there is no link at all) but to executables, you can find info about manifest files at Microsoft.
You can merge multiple files together. I'm not sure of the details, but it should be easy to work out... I suspect you just need to copy the security section to the other file.
Re: Win7 and vista permission problems
Thanks Si,
I'll try it out
Re: Win7 and vista permission problems
It isn't a question of "merging files together."
An application manifest is an XML document that can provide lots of information about your application to Windows. Just copy/pasting things into your manifest can have effects you don't expect if you don't understand what you're doing.
For example the presence of a trustInfo section tells Windows your program is "Vista aware" which will bypass many 9x/XP AppCompat shims. This can cause your program to fail in unexpected ways if it isn't actually aware of the rules of the road.
Re: Win7 and vista permission problems
la volp has posted an app (source) to add manifests to your project res file, for both xp styles and admin elevation