jgcode Posted December 2, 2009 Report Share Posted December 2, 2009 I know writing to ProgramFiles is not allowed in VISTA onwards, but was allowed in 2000/XP (only with admin installation, default user account - which is probably most cases) However, does anyone do any "read only" stuff in ProgramFiles? The 2009 Config API by default does not write to disk on Close anymore and the Read Text (but not Read Binary) when set with the Read Only permission works in ProgramFiles. Alot more application are "portable" these days - being able to run off USB etc.. or moved around in location. Does anyone utilize this for read-at-startup-only type configs? Or is it considered a big nono? Cheers JG Quote Link to comment
crelf Posted December 2, 2009 Report Share Posted December 2, 2009 However, does anyone do any "read only" stuff in ProgramFiles? Sure, that's totally fine. When you think about it, your exe is there and you read it. I'm looking into doing more stuff in the registry actually - I figure if it's local data that the application needs access to (and needs to be able to edit it) then it should be in the regisrty, whereas if the user needs access to it then it needs to be in their folders. Nothing that I've done a lot of research into as yet, so maybe someone else could comment? I figure I can create a reuse compnent that is essentially a drop-in replacement for the ini file read/writes... Quote Link to comment
jgcode Posted December 2, 2009 Author Report Share Posted December 2, 2009 Sure, that's totally fine. When you think about it, your exe is there and you read it. I'm looking into doing more stuff in the registry actually - I figure if it's local data that the application needs access to (and needs to be able to edit it) then it should be in the regisrty, whereas if the user needs access to it then it needs to be in their folders. Nothing that I've done a lot of research into as yet, so maybe someone else could comment? I figure I can create a reuse compnent that is essentially a drop-in replacement for the ini file read/writes... Great point! I thought I read somewhere that with VISTA and 7 there was a push to move stuff out of the registry? I.e. amped up security there too for write access. Is anyone else fond of the registry - and how does this translate across platforms? (have only programmed Windows OS). Quote Link to comment
Shaun Hayward Posted December 3, 2009 Report Share Posted December 3, 2009 (edited) Great point! I thought I read somewhere that with VISTA and 7 there was a push to move stuff out of the registry? I.e. amped up security there too for write access. Is anyone else fond of the registry - and how does this translate across platforms? (have only programmed Windows OS). The Windows Registry has more permissions controls in Vista+ but if you put your settings where Microsoft would like you to, then all should be fine. In particular, if you keep your application settings in HKEY_CURRENT_USER\Software\<Company Name>\<Application Name>... you should have no problem. One of my personal pipe-dreams with the registry access is to create something that could work similar to the (Un)Flatten class to XML VIs, whereby it could take a LabVIEW object and create an appropriate hierarchial bunch of keys/values in the registry automatically (and ideally, cope with version changes - probably leveraging the XML VIs to let LV deal with the mutation). Edited December 3, 2009 by Shaun Hayward Quote Link to comment
Yair Posted December 3, 2009 Report Share Posted December 3, 2009 The 2009 Config API by default does not write to disk on Close anymore You scared me for a moment, but this isn't actually true. Quote Link to comment
jgcode Posted December 3, 2009 Author Report Share Posted December 3, 2009 You scared me for a moment, but this isn't actually true. Ok, sorry for the scare To clarify what I meant: LV2009 The Close VI, by default, will not write to the config file if it has not changed. E.g. Therefore you can perform a read and it will work in ProgramFiles using the defaults. LV8.6 The Close VI, by default, writes the configuration file each time. E.g. Therefore you can perform a read and it will not work in ProgramFiles using the defaults. It just a default, but I thought the change was interesting to point out. as I got a different behaviour when the same code in different LabVIEW versions. The Open VI has 8.6 on it, but Close VI is upgraded to the new one. Therefore I was just wondering if this change to the API was done as a request from users, or to facilitate e.g. ProgramFiles read-only by NI (conforming to VISTA/7 standards or something etc..)? Quote Link to comment
Yair Posted December 4, 2009 Report Share Posted December 4, 2009 The Close VI, by default, will not write to the config file if it has not changed. Ah, yes. That makes more sense. I don't know why that specific change was made, but it should be noted that it was actually part of larger overhaul of the config VIs which changed their internal code and moved them into a library, so that you can longer use the internal VIs. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.