キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

Build a Application EXE with File who remeber the Path

Hallo,

 

i have a VI who has to open a Text file and has to safe in diffrent Text and Excel files. When i Build a EXE and open it on a diffrent Computer its always searching for the Paths i used a my PC.

How is it possible that the EXE is remembering the Path i put in after closing the EXE?

 

Regards,

Felix

0 件の賞賛
メッセージ1/11
2,955件の閲覧回数

Lots of things could cause that.

 

Default values, constants, ini file values.

0 件の賞賛
メッセージ2/11
2,927件の閲覧回数

does it meen that normaly the EXE remembers the last value?

0 件の賞賛
メッセージ3/11
2,914件の閲覧回数

@felixfelex wrote:

does it meen that normaly the EXE remembers the last value?


no.

0 件の賞賛
メッセージ4/11
2,910件の閲覧回数

It would be a lot easier to help if you could share your code. The exe will not "remember the path" from the previous run unless it has been programmed to "remember the path." Without seeing your code it is impossible to guess as to how it is programmed.

0 件の賞賛
メッセージ5/11
2,905件の閲覧回数

Here is a Part of my programm. When i build a exe i want that the Exe remebers the last path i put in by using the exe.

My Problem is that i want to use the Exe on diffrent PCs but the Path is always the path i was using by creating the VI. On the other PC this Path didnt exist.

0 件の賞賛
メッセージ6/11
2,875件の閲覧回数

You could use the ini file that LabVIEW makes for executables.

 

The source code can use a similar ini file.

 

When building the exe, you can choose to use a custom ini file. So you can give your executable an ini file with a path that is the same for each executable, but different from the path your source code used.

0 件の賞賛
メッセージ7/11
2,872件の閲覧回数

Can you explain a little bit more please. 

0 件の賞賛
メッセージ8/11
2,863件の閲覧回数

@felixfelex wrote:

Can you explain a little bit more please. 


What aspect?

 

You can interface with ini files though a library. Either NI's "Configuration File VIs" or a library (like Configuration-File-Library ).

 

You'll need to open the file, and read the value when you start, write the value when you change it or when you save the file, and save the file.

 

Opening the correct file (the source file could be at a different relative path from the executable file) can be done with the Application Directory function.

 

"Use custom configuration file" can be found under Advanced in the exe's build specification.

メッセージ9/11
2,854件の閲覧回数

Combining a User-Created .ini File with LabVIEW.ini for Distribution 



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
メッセージ10/11
2,849件の閲覧回数