Jump to content

hooovahh

Moderators
  • Posts

    3,433
  • Joined

  • Last visited

  • Days Won

    289

Posts posted by hooovahh

  1. is pv.exe bundled with Windows? I cannot find it in my install (hence the reason why you embed it in the code I suppose).

     

    Are you sure you are legally allowed to distribute pv.exe in any form?

     

    Edit: sorry just followed the pv link you included above, so it's not a windows tool, but am still not sure about the distribution of this.

     

    Yeah you are probably right.  I certainly wasn't trying to hide the fact that part of the code was not mine, and that it was part of a freeware application.  I actually found the download on a site somewhere as just an EXE download without any attribution or history of where it came from.  Still the whole two wrongs thing.

     

    I tried for a long time to accomplish what this little EXE program does natively, or using VB calls but couldn't find any thing, just some possible ways to do it in C that I couldn't get to work.

     

    For those not adventurous enough to run random EXEs off the internet, this EXE has many functions but the one I use is given a EXE name, it will provide the PID(s) for those running applications, and the full path on disk to their locations.  If you open Task Manager you can see the PID column for all applications, and you can right click and choose Open File Location.  This is the functions that I couldn't seem to do with DLL calls to Windows, or VB and .Net calls.

  2. The installer doesn't put the ini into the [Public App Data]<Company Name><Application Name> folder, it just creates the folder and unlocks it.  If the folder already exists, then nothing happens and your custom ini file remains intact.  The default ini that is with the exe is overwritten, but since the ini already exists in the App Data folder, the ini with the exe is not used.

    I wasn't talking about the App Data folder, I was talking about normal NI installers and how standard operation is for now with applications I make.  I was saying that normally someone would need to change the permissions on the INI file in the Program Files folder if the application is going to Read/Write it.  This was done using the command line program icacls but using the "unlock" on that INI file removes the extra step of having to run icacls but will still overwrite the INI (in Program Files)

     

    I understand how you handle INI settings and I will try to use something similar in the future after some initial testing.

  3. I don't use private methods often, and as a result I don't know what other methods are available.  When I do turn on private methods I find that there are a ton and they some times will slow down my development, because there are so many that I will not use 99% of the time.  For this reason I find myself enabling and disabling private methods and I wanted an easier way to turn them on and off.  I made this VI (and it's supporting code) to run from the Tools menu of LabVIEW (place in the <LabVIEW>Projects folder) which will change the LabVIEW.ini key, and then restart LabVIEW.

     

    post-6627-0-80664200-1361887186.png

     

    Disclaimer 1: Private methods are not supported by NI and should not be used in build applications, and are generally only used for tools of development.  

    Disclaimer 2: This set of code contains an EXE (pv.exe) and will be saved and executed from the system temporary folder %temp%.  Information about this EXE can be found here.

    Disclaimer 3: As stated in the main VI, this will taskkill the version of LabVIEW running, and all unsaved work will be lost.

     

    Any feedback is appreciated, thanks.

     

    EDIT: This code uses OpenG File Library.

    Enable Disable Private Methods.zip

    • Like 1
  4. Occasionally I will be working on multiple projects that at one time split from each other.  Because of this there will be many VI with the same name in both projects.  To keep things simple I will only open one project at a time, but sometime I will do something stupid and have one project link incorrectly to the other projects VI.  A tool I've wanted to make is to open a ref to all VIs in memory, get their paths, and build a tree with a directory view of all VIs loaded.  This way I can see quickly which VIs are being called from where on disk.  This type of tool could take advantage of this private method because I don't care to load all other dependencies when I open my references.  I just need to know the path (and assume all the VIs are already in memory) that I want to scan.

  5. This was my first thought also. This is an extremely handy method for performing VI server tasks on a single VI that don't require its static hierarchy to be loaded (psstt... this method can be orders of magnitude faster than Open VI Ref since, not only does it not load static dependencies, it does not load the owning library definition or sibling members).

    It is very fast.  I did a test on it by having it find all VI recursively in a directory, then open each of them and read the Connector Pane Image, VI description, VI Controls and their descriptions.  Finding the VI files took longer than performing all the other operations.

     

    EDIT: Actually I had a bug in my code the timing is not quite correct. On a directory containing 440 VIs (in sub folders too) it took 71ms to find all of them using the Recursive File List.  Then it took another 4.8s to open those 440 VI references.  The time to read the data was a bit flawed too but is on the order of 8-10 seconds.

  6. I didn't know about the 'unlock' switch in the installer, so to get around the user access issues I was using the "icacls" command to set the user permissions. When the ini file is first created under ProgramData, I feed the command "cmd /c icacls "<path to ini file>" /grant BUILTINUsers:(F) /t" to "system exec.vi". This assigns all users full access to the ini file.

    This works fine as far as I can tell, but I'm a bit nervous about using commands I don't really understand, so I might switch to the 'unlock' folder method instead when the issue with LV2012 is fixed.

    I've used icacls before for setting permission as well (before I knew about the unlock feature).  What I did then was install like normal, and then I needed to remember to run the batch file to change INI permissions after the install.  Unlock removes this extra step but again will simply overwrite the INI during the install (which is where this topic came from in the first place)

  7. Win 7 has some unexpected rules when it comes to the ProgramData folder, you can create and modify files (and folders) but if you switch users, they only have read access.  So for this I have my installer create the folder where I will be storing the modified ini (by creating a new destination [Public App Data]<Company Name><Application Name>), and set the folder to unlocked.

    Awesome idea.  Yeah I was thinking about how all of this would work when switching users as well.  I have not run into this myself but apparently there is a bug with 2012 with the unlock that doesn't work properly.  Sounds like it is planned to be fixed in the next release

  8. What I'm doing right now can be considered non-standard.  The INI and EXE go into the Program Files folder, and the INI has been "unlocked" by the NI installer.  This makes it so anyone on the system has permission to write to it (but no other files).  I've known for a while that files under Program Files should not be changed after the installer because of user permissions issues and that the ProgramData is the correct place for this information.  To be more standard moving forward I think it would be a good idea to try what bmoyer suggested.  I can have the installer install into Program Files the EXE and INI and keep them locked to read-only.  Then settings are read from the ProgramData first.  If the file doesn't exist (or there is an error in reading the Section/Key) use the INI file in the Program Files.  Then when making changes save to ProgramData.

     

    An added benefit I didn't think about with this approach is I can have a "Reset to Default" button that will simply delete the ProgramData INI file, causing the software to use the Program Files INI for settings.

  9. Hello all.  I have an application.  This application has an installer.  During the install the EXE and the INI file are installed and the EXE uses the INI and can then write to the INI any settings changed in the application.  If I have a new version of the application I make a new version of the installer.  The problem (if it is one) is that during the install the new INI will replace the old one and all of the old settings will be lost.

     

    On the one side this is a good thing.  This means that when version 2.0 is installed it comes with an INI file that is compatible with the 2.0 of the EXE and will have known good settings.  On the other side this means that if there were any custom settings they will be lost.  It is possible to run a EXE after an install, so I was thinking one possible solution could be to backup the old INI (sometime before deleting it) then after the install compare the two and any keys and sections that exist in the old and new INI, to be copied so the new INI has the same settings as the old.

     

    Any thoughts on this?  Is this a non-issue and installing a new EXE with the new INI is the way to go, with the understanding that old INI settings will be lost?  Thanks.

    • Like 1
  10. Anyways, I reread my own post and I may be coming off as something of a doomsday preacher. Sorry about that to all of you!

    No worries.  There are days where I come on here and probably say things out of emotion and say things I don't mean to try to get a point across.  Password protection, IP protection, and low level LabVIEW secrets on this forum have been a hot topic, and people are very opinionated, which makes for some topics which seem to add nothing to the greater knowledge that this forum is intended for.

     

    I understand your position and feelings about IP and DRM.  I also understand what flarn wants to do, and to an extent what drives him in his pursuit of all that is LabVIEW secrets.  I too would like to know the dark secrets of LabVIEWs inner workings.  I'm always interested in what there is to learn when it comes to LabVIEW, but at some point you cross the line and for everyone that line is different.  Laws are intended to make that line the same but in many cases is still a grey area.  In my opinion stating that "we need a new password cracker" goes too far, but at the same time I did not know that in 2012 the password scheme was changed to counteract previous flaws.  And had it not been for this post I may have never known.

     

    Man I'm all over the place with this post.  I congratulate anyone who understood the message I was trying to say.

  11. - There is no difference whatsoever between intellectual property and physical property. If you can't see that then you just have to live a while longer and it will dawn on you eventually.

    This is just silly.  Of course theres a difference.  If there was no difference we would use the same word to describe both types of property.  In the dictionary if you look up Intellectual Property it will not say "See Physical Property".

     

    I also don't condone releasing anything to break NI's password protection scheme, but I also think it isn't in your place to say that he "WILL get into trouble" if anything is released.  What happened to the last guy that released a password cracker that works on all VIs between 7.x and 2011?  Well I don't know for sure but his website is still up with the source code, and will even remove the password by uploading a VI.

    • Like 2
  12. Sometimes Ctrl+. helps. And you can almost always close the parent vi using the task bar context menu and it will terminate the blocking sub vi.

    This won't work if the SubVI isn't being called in the code yet and is just in memory.  I believe this is the situation Minh was describing.  I've used several AbortVI functions in the past to be able to abort any VI running (not a close at the moment).

  13. The current design won't allow vertical separators as it uses an array of picture controls (so each slot is a fixed width). The new version replaced that with a single picture control and lots of messy code to work out which part of the picture needs to be redrawn when the user interacts with it. The messiness is one of the reasons I've never finished it !

    That does sound messy.  The other solution I was tossing around in my head, was that each picture could be a separate running VI.  Then you can register for a mouse enter/leave for interaction, and mouse down to know which was clicked.  I did a quick test here which displays images, and each image is a VI.  It's far from perfect, and it actually does resizing (which you wouldn't want to do) but it may give you a new approach.

  14. These are pretty much the reasons I've never released the code 'officially'. Actually the XNode dependency and hence the Scripting tools dependency is pretty easy to strip out and replace with 'static' code. I've sort of intended to do so for ages but somehow other things keep getting in the way. Also, I've a very long term, slow burning, project to replace the whole toolbar with something a bit more flexible that could include other types of control, not just a push button.

    This is not a feature request by any means, but if you are thinking about making the tool look more native I would suggest having vertical separators  and a function that allows for resizing the window, which would collapse buttons into a single button when they all can't fit in the display.  See the image of Foxit Reader which collapses the buttons to a >> button which don't fit.

     

    post-6627-0-16415700-1360595443_thumb.pn

     

    Just a thought.

  15. Okay so I've never really dipped my feet in when it comes to XNodes.  At the moment I'm not looking to make XNodes just understand using them, and really just get others to tell me it's safe.

     

    The ones for discussion are the Array XNodes, and the OpenG Array XNode.  I see the functions this code has and I love the idea of using it.  But I know that there is no support from NI for using XNodes, and I've heard NI say that using them can be quite dangerous (without specifically saying what it could do or how to avoid it).

     

    So I want to pose this question.  Is the Array XNodes in the Code Repository as safe to use as the normal OpenG array functions?  Is there a compelling reason I should not be using XNodes of any kind in an application?  I assume Lava would not certify code that was unstable, and I also see that people are using these functions (over 3000 downloads combined).  So is there nothing to worry about here?  And if these are so great and stable, should I exclusively use these instead of the real OpenG ones?

  16. Here's a toolbar XControl that I developed for one of my applications. It's not really intended for public consumption, so it's almost entirely undocumented and may not all work as exepected or indeed as I intended :-), but there is a minimalist example included in the project.

    Amazing, the community again thanks you for your contribution.  The case as you put it is quite undocumented, and needs work, but the concept is there and it works just well.  Also it should be noted to get this to work you need to install the Array XNode library, which also requires the lava_lib_labview_api_scripting_tools package as well.

     

    ...However I feel the need to post a topic using XNodes, simply because all I've heard about it is how unsupported it is which makes me nervous.  That being said NI said the same thing about Scripting before it was released and I was using it then too.

     

    EDIT: I made a post expressing my concerns with XNode usage.

  17. So I had a thought.  There are primitives in LabVIEW that aren't exposed, just like there are VIs in the vi.lib that aren't on the palette.  But the thing about vi.lib VIs is I can navigate the the directory and find the VIs on disk.  My question is how does one find primitives not exposed?

     

    I've seen a few instances where someone will post a VI with a primitive I've never seen before and I wonder how people find these, other then finding them on the block diagram of another VI.  A few examples I can think of are the Text to UTF-8/UTF-8 to Text, and Coerce to Type.

     

    Again I understand the reason why these may not be exposed, and I understand the reason why someone would not want to use them.  But I can't help but wonder, where are primitives on disk?  Where is their information stored (VI description and help path for example).  And how can someone find primitives not on the palette?

  18. The solution is to architect the VI to only use one event structure.  There is no need to poll in the timeout case of the first event structure, just handle all events the user can perform (like Panel Close :angry: ) in the one event structure and enqueue any states needed to handle the event.  Another side effect of your code is I can't press new game, if a game is still going on.  Again having one event structure handle everything the user can do is the way to go.

     

    Not sure how many pointers you are looking for but here are a few:

     

    The User Logon screen doesn't need the FP.Open or FP.Close (and then won't need the sequence structure) because the VI is configured to open when called, and close when done.

     

    If you want the logon screen to be seen first, why is this not the top level VI and then have it call the UI that the user plays with?

     

    The Logon screen doesn't allow the user to close, and I couldn't find a way to stop it other then the abort button.

     

    The Main screen doesn't allow the user to close.  There is a button but using the normal close is more standard for users unfamiliar with your program.

     

    Get rid of the toolbar for the logon screen.  There are tons of items in there that are just LabVIEW specific.  Only show the toolbar if you have a custom toolbar with items for your program.

     

    Use more states in your QMH.  You have alot of code in the Idle case (with the event structure).  It helps to more easily follow the code if there are multiple states to call so they can be reused.  You could have a state called "Draw UI" which can be called on startup, and every time the user or AI moves.

     

    Your sub VI's have error terminals in locations not seen often.  This isn't bad exactly but error wires are usually on the bottom right and bottom left terminals.  This borders on the line of style guide or preference not sure which.

     

    Control labels being on the right is a preference thing but I think looks nicer.

     

    You have some wires on top of other wires and going in the same direction.  This makes it very difficult to know exactly where a wire is connected without have to triple click it.

     

    I saw some silver controls.  As I've mentioned before I don't have them but it should be consistent. The ones I saw were the error wires by the way.  I also saw some classic error controls.

     

    You are using the Value Signal property node but I don't see where the event is handling the value change.  If you just want to change the value use a local variable.  Or at least use the Value property.  Value Signal indicates you are firing an event for a reason.

     

    Unneeded coercion dots.  A coercion dot isn't necessarily a bad thing, but they can be so avoid them by giving the correct data type or perform an explicit conversion to the right type, knowing the possible consequences.

     

    That being said, you have nice labels, code description, and I like the tab solution for the UI.  You are doing well for someone with a month of LabVIEW experience.

    • Like 1
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.