LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Alter file path without recompiling

I have a LabVIEW program compiled with version 7.1. Unfortunately, it was not compiled properly and I do not have the original source.

You see, after experimenting with Filemon I have determined that the VI is trying to read or write to a file named c:\[whatever]\viname.exe\settings.cfg . Of course, this path makes no sense in the Windows filesystem, though I understand such an access attempt is not unusual for LabVIEW projects.

Is there some way I can get around this problem without the original source?
0 Kudos
Message 1 of 6
(2,934 Views)
It seems that this path does makes sense to Windows, as I was able to create a similar file on my PC. But of course, it doesn't quite make sense for us Smiley Wink.
The only possibility I can see is to open the exe file with an hex editor and change the path writing into it; this has several drawbacks, for example you may not change the length of the individual constants used to build the name, so if the path was obtained by building successively [whatever], viname.exe and settings.cfg, you are not allowed to relocate the file into a C:\ mysinglecnfgdirectory  directory, for example, but you need to respect the two steps directory nesting, like in C:\myapplicat\my_vi_name\settings.cfg

Message Edited by pincpanter on 03-05-2007 05:14 PM

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 6
(2,921 Views)

kehander wrote: ... though I understand such an access attempt is not unusual for LabVIEW projects.

It is very unusual once the programmer knows about these issues, e.g. after reading this application note

:)

0 Kudos
Message 3 of 6
(2,913 Views)

@pincpanter wrote:
The only possibility I can see is to open the exe file with an hex editor and change the path writing into it; this has several drawbacks, for example you may not change the length of the individual constants used to build the name, so if the path was obtained by building successively [whatever], viname.exe and settings.cfg, you are not allowed to relocate the file into a C:\ mysinglecnfgdirectory  directory, for example, but you need to respect the two steps directory nesting, like in C:\myapplicat\my_vi_name\settings.cfg



That did not occur to me. Unfortunately, it seems to me that the path is simply generated from the VI's current directory and filename rather than component-wise as you suggest.

I'd have thought a mistake like this would still be sufficiently common that there might be an easy way around it. There's nothing I can do with LabVIEW itself to alter the compiled EXE, is there?

Message Edited by kehander on 03-05-2007 10:36 AM

0 Kudos
Message 4 of 6
(2,904 Views)
No there isn't (AFAIK). However, it seems that the program was never alive, so even if you could correct this (rather trivial) bug, it wouldn't be granted to work well... or not?
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 5 of 6
(2,898 Views)
I guess I forgot to mention that right now it would just be sufficient to get a copy of settings.cfg .
0 Kudos
Message 6 of 6
(2,893 Views)