03-03-2024 02:51 AM
Hello, I often make an installer for my labview code. The code works fine in differnt PCs but if I decide to write in TDMS database there would be a problem. As my code is inthe first drive of HDD, on C or a some where in labview folders, incase I run the installed labview developed code as an administrator TDMS creating and writing is fine otherwise, TDMS data logging return an error and say it is not possible to wite the data within the database.
My question is, how I can make an labview code installer that the shortcut on my desktop have an already enabled administrative right? It is not suitable to leave a note for customers that if you need the code work flawlessly run it as an administrator! Or give it a permanent administrative permission!!!
Thanks
SAMY
03-03-2024 05:52 AM
First, there is no way to install an application to always have administrative privileges unless you want to wander the thorny path of creating a Windows service!
You could create your own installer that makes the installation directory of your application user writable, but that is so Windows 3.1/95, and might put your application on the index of most unwanted programs for some IT departments!
The correct way is to not try to write into your application folder at all but instead use a custom subdirectory in one of the User Documents or Common Documents folders. There is a VI in the File functions palette to retrieve the location of these and quite a few others at runtime.
03-03-2024 11:01 AM
A follow-up to @Rolf's post:
A technique that I've used involves the following:
Bob Schor