LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Configuring the Create Distribution Kit

My CVI application reads and writes to a ini file. The Distribution kit installs the application and associated files with no problems. When the program is executed from the Windows Start shortcut the ini file is always written to the /program file/common files/system/mapi/1030/NT folder instead of the application folder. How do I configure the distribution kit panel to tell windows how to point to the application folder. I can correct this by editing the shortcut properties in adding in [start in:] adding the path. This has to be doable from the distribution kit? It�s not apparent to me. As anybody had this problem? Anybody have a solution ?
0 Kudos
Message 1 of 3
(2,881 Views)
IME it is never a good idea to rely on the default path being correct. Who knows what sort of shortcuts the users will create for themselves, then blame you when they don't work properly?

If you want to ensure that the ini file you write is in the application directory, use the GetProjectDir() and MakePathname() functions in your application code to fully-qualify the ini filename. A bit painful the first time, but if you make a habit of it you'll never regret it.

--
Martin
--
Martin
Certified CVI Developer
0 Kudos
Message 2 of 3
(2,881 Views)
Greetings,

Unfortunately, this is a bug in the 6.0 distribution kit. The problem is that the "Start In" directory is not set correctly in the new shortcut, which causes that application's working directory becomes whatever Windows defaults it to - certainly not where your application is installed.

For now, the best fix would be to add a call at the beginning of your application to GetProjectDir(), then passing that result to SetDir(). GetProjectDir returns the location of your .exe, and SetDir sets the current working directory.

Thanks,
- Wes / NI
Message 3 of 3
(2,881 Views)