Jump to content

How can I get executable path in registry key after use of an installer?


Recommended Posts

Hello,

I made a project which use a client vi and also a Custom Periodic I/O server which communicates with an apparatus "home made" via TCP/IP. All works properly, and I have to do now an Installer for this project. The final user can choose where he wants to install the executable. In my I/O server, which runs in Background via tagsvr.exe, I need to know the path of the client executable, because this server generates datafiles and I would like to store them in the same folder than the executable, in order to make it easier for the user to retrieve them.

But I don't know how to proceed...In the server, first, i used Application directory.vi thinking that the lib which manages the server is belonged to executable folder, but actually, the server path is C:\Program Files\National Instruments\Shared\Tagger. This is normal actually since this is the path of tagsvr.exe....

So my question is how can I retrieve the folder of the client executable in the I/O server, from where I can build paths for data in the correct folder?

I think about registry key, where after using installer, the path of the executable chosen by user could be stored, but I don't know if it's possible....

Thanks for your answers and ideas!

Antoine

Link to comment

Hello,

I made a project which use a client vi and also a Custom Periodic I/O server which communicates with an apparatus "home made" via TCP/IP. All works properly, and I have to do now an Installer for this project. The final user can choose where he wants to install the executable. In my I/O server, which runs in Background via tagsvr.exe, I need to know the path of the client executable, because this server generates datafiles and I would like to store them in the same folder than the executable, in order to make it easier for the user to retrieve them.

But I don't know how to proceed...In the server, first, i used Application directory.vi thinking that the lib which manages the server is belonged to executable folder, but actually, the server path is C:\Program Files\National Instruments\Shared\Tagger. This is normal actually since this is the path of tagsvr.exe....

So my question is how can I retrieve the folder of the client executable in the I/O server, from where I can build paths for data in the correct folder?

I think about registry key, where after using installer, the path of the executable chosen by user could be stored, but I don't know if it's possible....

Thanks for your answers and ideas!

Antoine

You can use the default data directory VI for both ("Dflt Data Dir.vi" located at the "File Constants" pallet) .

it will return a common path like: "C:\Documents and Settings\User_Name\My Documents\LabVIEW Data".

Link to comment

If you are working on Windows (and probably on other OSes as well) you should store the files in a system folder - and use the Get System Directory VI to get the path to it in both applications.

Storing files together with applications that are installed in the Program Folder is not permitted on Vista and Windows 7 (no write access, this was true for earlier OSes as well, but back then everyone had the bad habit of being an admin...).

The choice of system folder is not straighforward though...you could use the user's document folder or application data (hidden) - but then the location will vary with the user...or you can use the common ProgramData folder...but then only the server will get write access, the clients will only have read access unless you use a tool to edit the access rights. The latter would not be a problem if the server was in fact serving the data to your clients via a data link (TCP/IP e.g.)...and that would be more flexible than to require access for the clients to the local files, but I assume that's out of the scope.

Here is a related discussion about where to store files on Windows.

MTO

Hello,

I made a project which use a client vi and also a Custom Periodic I/O server which communicates with an apparatus "home made" via TCP/IP. All works properly, and I have to do now an Installer for this project. The final user can choose where he wants to install the executable. In my I/O server, which runs in Background via tagsvr.exe, I need to know the path of the client executable, because this server generates datafiles and I would like to store them in the same folder than the executable, in order to make it easier for the user to retrieve them.

But I don't know how to proceed...In the server, first, i used Application directory.vi thinking that the lib which manages the server is belonged to executable folder, but actually, the server path is C:\Program Files\National Instruments\Shared\Tagger. This is normal actually since this is the path of tagsvr.exe....

So my question is how can I retrieve the folder of the client executable in the I/O server, from where I can build paths for data in the correct folder?

I think about registry key, where after using installer, the path of the executable chosen by user could be stored, but I don't know if it's possible....

Thanks for your answers and ideas!

Antoine

Edited by Mads
Link to comment

Hello,

Thanks a lot for your answers, I will have a look on your ideas.

Cheers

Antoine

PS: I attach a test project, (test.zip) with a custom periodic server based on server.vi, which refects what I need. You can see I used Call chain.vi to get the path of the server itself when it is running (vislt_serverXX.vi). But if I opened a ref on it to get its path, I have a <not a path>...The idea was to retrieve the path of vislt_serverXX.vi, because when I create an exe, I noticed that in the builds folder, there is a folder \builds\LVDSC\Custom VI Periodic Server\9.0\templates inside. And this folder is included in same folder than the .exe

I attached also a picture showing dsm, with my server running (post-17476-12732215004_thumb.jpg).

Thanks again

Link to comment

Hello,

Thanks a lot for your answers, I will have a look on your ideas.

Cheers

Antoine

PS: I attach a test project, (test.zip) with a custom periodic server based on server.vi, which refects what I need. You can see I used Call chain.vi to get the path of the server itself when it is running (vislt_serverXX.vi). But if I opened a ref on it to get its path, I have a <not a path>...The idea was to retrieve the path of vislt_serverXX.vi, because when I create an exe, I noticed that in the builds folder, there is a folder \builds\LVDSC\Custom VI Periodic Server\9.0\templates inside. And this folder is included in same folder than the .exe

I attached also a picture showing dsm, with my server running (post-17476-12732215004_thumb.jpg).

Thanks again

Here's an installer option that works fine :

registry_install_for_lvproj.jpg

Hugues.

Link to comment
  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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