LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Installer on different windows

 

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

0 Kudos
Message 1 of 3
(542 Views)

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.

Rolf Kalbermatter
My Blog
Message 2 of 3
(501 Views)

A follow-up to @Rolf's post:

 

A technique that I've used involves the following:

  • Always develop in the context of a LabVIEW Project, which creates a folder that I will call "My Project" and that, by default, lives in C:\Users\Your_ID\Documents\LabVIEW Data\Your_Project).
  • Within your Project Folder, create a sub-Folder called Data.  Open the Project and add this Data folder to the Project.
  • To access "Data Files" inside the "Data Folder", you need to know the location of the Data Folder on disk.  When you are in Development Mode (i.e. coding in LabVIEW), the LabVIEW File Control "Application Directory" (in the File I/O Palette under "File Constants") points to this Folder, so you can locate any file in this folder by using Build Path with Application Directory wired to the Folder input and the string with the Path Name you want wired to the File input.
  • If you build your Project into an Application, the Folder containing the Application will have a sub-folder called "Data" inside it.  Any files in the \Data folder of the Project will be copied to the \Data folder of the built Application.  The "magic" is that the Application Directory in the built application points to the Data Folder in the built application.  The code works in both Development and Execution mode.

Bob Schor

0 Kudos
Message 3 of 3
(478 Views)