martin Posted September 28, 2009 Share Posted September 28, 2009 I have only just tried installing a couple of applications on a Vista PC. (I know, I'm years behind.) One application ran for about 24 hours without needing to confirm that it really really was supposed to be running even though it wrote (believed it wrote) to the Programs File folder. I updated the script so that it now writes data to @AppDataCommonDir\Blah\subBlah. Fine for a few hours, (maybe a reboot?) and now it warns that an "unidentified program wants to access your computer". It reads HKCU to find out where the data folder is. I have another application which reads and writes to a file in @AppDataCommonDir and also reads HKCU but so far it doesn't bring up the "unidentified program wants to access your computer". I read that I will get the message if the program tries to access certain areas but I cannot find a list of what those areas are and I cannot see why one program is different to the other. I really need an idiots guide to writing applications for Vista. For me that would equate to a "Noddy goes to Vista land". I downloaded TopWave but it seems to link to things that link to TopWave and so far hasn't helped me. I am th eonly user on the PC and I have administrative privileges. Those 2 apps are written in AutoIt. I have a third program written in Delphi which does all the others do and more, is totally unaware of the existence of Vista so far and runs without any warning prompts at all. Since I don't understanding what is going on here I don't know how to proceed to fix the problem. Any advice is welcome. The Delphi program does not have any manifest file but I don't understand what these do in Vista yet. Most of my work is for machine controls and so far I haven't come across any machines controlled by Vista PCs, maybe I'm just lucky. While I'm on the subject, how does SciTE mange to read and write files in a Program Files subdirectory in Vista and never initiate any warnings? This reminds me of the problem of safety in machines. Some safety systems are so awkward for the users that they find ways to bypass them and end up with no security at all. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Mobius Posted September 28, 2009 Share Posted September 28, 2009 (edited) http://www.codeproject.com/KB/vista-security/UAC__The_Definitive_Guide.aspxhttp://technet.microsoft.com/en-us/magazine/2007.06.uac.aspxI am not much of a vista user either, so sorry if this info is utterly useless to you Martin. Edited September 28, 2009 by Mobius Link to comment Share on other sites More sharing options...
monoceres Posted September 28, 2009 Share Posted September 28, 2009 Ok, here's my tips/knowledge. When you write applications for vista+ you need to make a decision. Is your program gonna be available for standard users. If so then behave. Don't write/read from HKLM, don't write ANYWHERE but to @AppDataDir, this will probably keep the warnings at a minimum (note that this is not universals truths, but only observations I've made). If you want it to do funky stuff, request admin rights. And this is where the manifest comes in. The manifest is simply an XML document embedded as a resource in an exe that tells windows what privileges you want. It's just like adding #RequireAdmin at the top of an script. SciTe probably gets away with it because installed applications can pretty much do whatever they want in the directories where they are installed. Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
martin Posted September 28, 2009 Author Share Posted September 28, 2009 @monoceres Thanks for that monoceres. It doesn't explain why one of my apps warns when it starts and another one doesn't. Neither writes to HKLM or reads from it. I don't see that a script can write to it's own directory where it's installed if that is inside ProgramFiles. My Delphi app is written to do that but it is actually redirected to the virtual directory and the files are all saved to and written from well outside of ProgramFiles although the program is unaware of that. SciTE must do something different I assume. I've only got 24hours of experience with Vista but it feels like a couple of weeks. @Mobius Thanks for the links, I'll look at them. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
ResNullius Posted September 29, 2009 Share Posted September 29, 2009 It doesn't explain why one of my apps warns when it starts and another one doesn't.martin,Are all the apps running from a local drive, or are is the one you're having trouble with running from a network share? Link to comment Share on other sites More sharing options...
martin Posted September 29, 2009 Author Share Posted September 29, 2009 (edited) martin,Are all the apps running from a local drive, or are is the one you're having trouble with running from a network share?All running from the same local drive which is also where the OS in installed.I have noticed that the one that is causing a warning is using a folder in ProgramData, but the the one which is also an AutoIt script but not generating warnings is using UserName\AppData\Roaming\somefolder, and the Delphi one is using the ProgramFiles folder but virtualised by Vista. I'll try changing so that it isn't using ProgramData for, um, program data. I probably misunderstood what ProgramData is for.Isn't there a nice simple guideline somewhere which says things likeProgramData folder is for ---, don't store info in here which is changed by the program or you will get this or that problem.ProgramFiles - only use for installation files which are never changed except for an update.I notice that ProgramData is normally a hidden folder. So I will try using only folders which are not hidden. Edited September 29, 2009 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Richard Robertson Posted September 29, 2009 Share Posted September 29, 2009 I believe the file warnings are all based on permissions. So if you were to just take ownership of the entire drive you'd have no such warnings for any file operations. Programs aren't supposed to write to the Program Files directory. This is a way to enforce good program design. Not sure why your scripts are accessing HKLM. Link to comment Share on other sites More sharing options...
martin Posted September 29, 2009 Author Share Posted September 29, 2009 I believe the file warnings are all based on permissions. So if you were to just take ownership of the entire drive you'd have no such warnings for any file operations. Programs aren't supposed to write to the Program Files directory. This is a way to enforce good program design.Not sure why your scripts are accessing HKLM. I am running with administrator rights and I am the only user. If I look at properties for C: I have all permissions ticked. Is that what you mean by "take ownership of the entire drive"?What file warnings? I cannot start the program normally because I am told "An unidentified program...". Is tha a file warning?I don't access HKLM and I specifically pointed that out.I ran the uninstaller. It ran without any warnings about being an unidentifed program. It deleted the program, the folder it was in,the data, removed registry keys and added registry keys to runonce on reboot and on reboot yet another script ran which did a final clean up. No warnings. So what I am interested to know is why does Vista allow all that but not the application I wrote which does a lot less.I've tried changing the foders to where I store data to all sorts of places but I still get the warnings, whereas the programs which are similar or worse as far as I understand it run without any problem. Does Vista remember programs which it has warned about so that even if you change it to remove the problem you still get warnings? Rebooting doesn't change anything.One strange thing is that the program which won't run normally will run up to 4 other programs which it makes child windows. I can run any of thes 4 programs without warnings and they read the same registry keys and use the same data as the main program.Another serious problem I have is that the child windows are no longer drawn correctly in the NC areas. When the program was first installed it ran without warnings and the child windows were drawn fine. Now that I get warnings the child windows are not drawn correctly. No borders and no icons and no buttons. The close button only becomes visible, ie gets drawn, when you move the mouse cursor over where you guess it should be. If you click where the caption bar should be and drag you can see that the borders are actually the background of the parent, and the background doesn't get repainted correctly. I can add some message to repaint when a child is moved but why should I need to do that and what has it got to do with how the program is run?I would have thought that these sort of problems that a newby Vista user like me is experiencing must be very common, so I am surprised that I can't find quick straightforward answers by googling, but I haven't been able to so far.EDITFixed it. As I suspected, Vista remembers programs that need permissions to run and then you are stuffed.I renamed the exe and now it runs fine and the child windows are drawn correctly again. Vista is a bit strange, even stupid at times IMO. My experience of Vista so far is not good. I fully understand what the security features are for but they are half baked and don't do what they are intended to do as far as I can see. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 29, 2009 Moderators Share Posted September 29, 2009 martin,Did you find out where Vista hides the list of apps previously needing permissions and if it is possible to alter this data? I have run into the same problem and I do not want to have to rename the app unless I really have to.I heartily concur that Vista is such a pain at times that many users are likely to turn off all the "security" features and be worse off than before!M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
martin Posted September 29, 2009 Author Share Posted September 29, 2009 martin,Did you find out where Vista hides the list of apps previously needing permissions and if it is possible to alter this data? I have run into the same problem and I do not want to have to rename the app unless I really have to...M23Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\LayersIn there was a key with a name which was the full path to the exe like thisC:\Program Files\Folder1\Folder2\Exename.exeand the value of the key was "RUNASADMIN"which was a bit of a give-away. Note that the registry key has a space between "Progam" and "Files" whereas the actual folder used does not have the space.I deleted that registry key, renamed my exe back to the original name, created a new shortcut and it works fine. End of problem it seems. (I'm hoping)So when Vista says "An unidentified program .." it can really mean "A program that we have previously decided (possibly arbitarily) should not be run as standard and we are not open to discussion despite any updates or changes.."I will try deleting that key in my installation/update program in future.Also, to my backward way of thinking, RunAsAdmin doesn't mean "run as though you are the administrator" which is how I first interpreted it, but it means only run if you are the administrator so RUNBYADMIN would make more sense to me. No doubt when Microsoft reads this post they will immediately recall all the Vista PCs in the world and change them. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 29, 2009 Moderators Share Posted September 29, 2009 martin, Thanks a lot - worked a treat. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Richard Robertson Posted September 29, 2009 Share Posted September 29, 2009 "Unidentified" may be referring to the lack of digital signature. Link to comment Share on other sites More sharing options...
martin Posted September 29, 2009 Author Share Posted September 29, 2009 "Unidentified" may be referring to the lack of digital signature.Probably. I don't know, but my programs are not digitally signed and are never likely to be.Vista has only complained about one of them so far and that was easily fixed. (Easily in retrospect.) Maybe the reason for the warning was the way I installed the program or the way I updated it. I haven't learnt much about Vista yet, but if I ran an installation or update as administrator would that mean that the app would be set for RUNASADMIN? I'll experiment and find out once I've sorted out an updater. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Richard Robertson Posted September 30, 2009 Share Posted September 30, 2009 No. The installer always needs to run as admin. If every installed program ran as admin because of the installer, that would make UAC pretty useless. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now