LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

exe settings history

Solved!
Go to solution

Why are you sorry, you provided the correct solution in the first reply! 😄

0 Kudos
Message 11 of 23
(1,657 Views)

Yeah, but it's not nice mushing someone's brain.  Smiley LOL

 

I could have elaborated and sent a useful link like you did.

0 Kudos
Message 12 of 23
(1,654 Views)

Well, after spending hours compiling questions, problems, thoughts, etc. I forgot I was sealing with the NI MS disease, and did not copy the page and a half I wrote.  When I hit POST, I receiver an "Authentication Mismatch" error and all was lost.

 

If this does not error out, I will start over again.

0 Kudos
Message 13 of 23
(1,628 Views)

Well clearly I meant to say "dealing with the NI MS disease", not "sealing with the NI MS disease".

 

The JPGs I prepared are attached below, but of course do not include the two hour of text I had written, that was lost via the NI MS.

 

I will try to recompose some of that if this seems to get published.

0 Kudos
Message 14 of 23
(1,627 Views)

From the previously sent JPGs, you will see that I decided to try the .ini in the EXE rather than the Registry solution to writing final values on quit and reading them as initialization on start-up so the tab settings of my Convert for Windows duplication in LabVIEW exercise would work correctly.

 

I just noticed a "Autosaved at 3:23 PM" message.

 

Is there any chance that the two hours of work I just lost can be retrieved?

 

0 Kudos
Message 15 of 23
(1,620 Views)

I have configured my build spec to copy my History.ini from my development/project directory and put a copy in the Convert.exe so I can read and write it from my Convert.VI top VI read/write sub VIs.

 

In "Source File Settings", I have specified "History.ini" to be "Always Included" with a Destination of "Support Directory".  In "Advanced", I have specified the custom "Configuration file in project" to be History.ini.

 

In "Destinations", Convert.exe has a destination of "C:\DOCs\LabVIEW\Build", Support Directory has a destinaton of "C:\DOCs\LabVIEW\Build\Convert.exe" and I open "C:\DOCs\LabVIEW\Build\Convert.exe\History.ini" for read and write which yields Error 7 - File Not Found in both cases.

 

I am going to send this and then remove the ".exe" from the path in-order-to see if that solves the problem.

0 Kudos
Message 16 of 23
(1,617 Views)

Nope, a path of C:\DOCs\LabVIEW\Build\Convert\History.ini gets the same Error 7 that C:\DOCs\LabVIEW\Build\Convert.exe\History.ini gets.

 

jyang72211 on 05-23-201209:48 AM said: I understand that you don't want a separate ini file.  You can actually compiled the ini file into your exe, so that it is just one exe, and the ini is out of sight.

 

That is what I am trying to do but ????  HOW!!!???

 

There was also a suggestion to use the registry rather than *.ini that also provided registry vi references, but I am hoping to spend the time understanding registries later, not now.

 

I do not know where to go from here.

0 Kudos
Message 17 of 23
(1,598 Views)

Sorry, no "Kudos and Accepted as Solution are welcome!" yet.

 

Some history:

jyang72211

Re: exe settings history

05-23-2012   09:48 AM

I understand that you don't want a separate ini file. You can actually compiled the ini file into your exe, so that it is just one exe, and the ini is out of sight.

sebster

Re: exe settings history

05-23-2012   09:46 AM

Using registry settings instead?

sebster

Re: exe settings history

05-23-2012   09:58 AM

I mean writing to and reading from Windows registry using the Windows Registry Access VIs.

There are examples shipped with LabVIEW.

altenbach

Re: exe settings history

05-23-2012   10:00 AM

All the tools you need are here:

Windows Registry Access VIs

(Look at the help. There are even shipping examples)

 

All,

I chose to do the .ini in the .EXE trick, and attack the Registry later, but with no "How To" access the .ini in the .EXE, it has not gone well.

 

I have spent hours looking for detail on the forum(of course nothing could be found in "HELP"), including a pathetic 32 post "LabView 2010 Application Builder for EXE Always Included files are not Included" that had no clear resolution for anyone except the expert who just needed a brief reminder - maybe.

 

Here are three JPGs to hopefully illustrate while I try to explain what I think I have tried to do.

 

 

It seems:  ( About a page and a half here was lost due to an "Authentication Mismatch" when I tried to post this.)

 

 

 

0 Kudos
Message 18 of 23
(1,597 Views)

jyang72211   on  05-23-201209:48 AM  SAID:  I understand that you don't want a separate ini file.  You can actually compiled the ini file into your exe, so that it is just one exe, and the ini is out of sight.

 

But HOW?

0 Kudos
Message 19 of 23
(1,596 Views)
Solution
Accepted by topic author 1LMR

I don't understand your reluctance in using the registry. Instead you prefer to "spend hours looking for detail on the forum" for your choice of using the ini in the exe trick.

 

Your original post was asking how programs 'remember' settings. Using the registry does just that!! As your program exits, write the relevant values to the keys. When your program starts next time, read those values back in. And there you have it - your program has 'remembered' the settings - no ini in sight.

 

You can have a case structure at the start to check if the keys exist, if they do then read them, and if they don't then create them.

 

 It's easy, just use the shipping examples:

 

 

Write to Registry.png

 

Read from Registry.png

Message 20 of 23
(1,582 Views)