LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Launch program before distribution kit installation

Solved!
Go to solution

When creating a distribution kit, there is an option to launch an application

after installation.

 

I would like to launch an application BEFORE installation.

Is this possible with the installer?

 

Specifically, I would like to run a program to save the configuration

files from the previous installation (which may have been modified

by the user) before allowing the installation of the new software to proceed.

 

 

Thanks in advance,

 

     Marty O.

0 Kudos
Message 1 of 7
(4,263 Views)
Solution
Accepted by topic author lomed

Unfortunately there is no mechanism to support that functionality. One alternative I would suggest is that instead of installing your config files, you have your application create them if they are not found. This way, your installer does not have to include them and will not overwrite them. The first time your application is run on a new machine, it will detect that the files are missing, and will create them with default settings. From then on, it will just read those files in. Your user can edit them without fear of losing changes in an upgrade.

 

Mert A.

National Instruments

Message 2 of 7
(4,259 Views)

Mert,

 

I like that idea. Why didn't I think of it?

 

Instead of compiling in the defaults, however, I decided to ship a sample file

and copy it to the correct location if the config file is not found.

 

Thanks,

 

     Marty O.

0 Kudos
Message 3 of 7
(4,240 Views)

Well, that didn't quite work. I was hoping that the installer would leave

the old config file in place, but it deleted it. The running my application

duly created a new one.

 

Is there an option to specify when building the distribution to tell it to

leave files alone that happen to be in the install directory but are not

part of the distrib? I took a quick glance at the edit window, but didn't

see anything.

 

By the way, this is using CVI 8.5.

 

Thanks for any further thoughts.

 

     Marty O.

0 Kudos
Message 4 of 7
(4,174 Views)

Files that weren't installed by the distribution should not be uninstalled by the distribution. Are you certain that's what's happening? For sanity's sake, I tried this in version 8.5.1, and it worked as expected. If you install a default config file, that one will be uninstalled, but any copies you make of it will stick around. You might try installing your distribution, manually copying a file into the directory, then uninstalling. That would distinguish whether the entire directory is being wiped out, or just your particular config file.

 

Let me know what you find.

 

Mert A.

National Instruments

0 Kudos
Message 5 of 7
(4,166 Views)

Marty,

 

I'm not sure you applied exactly what Mert described.

 

You shouldn't have put a file into the distribution kit.

That file, I guess, is what you referred as "old config file" in your message. That file, being a part of the installation, is subject to removal by the uninstaller. This is expected behavior.

 

Instead, you should be creating the file in your executable (using a function like fopen, OpenFile, etc.) upon its first run on that computer.

Of course you need to check first if the file exists.

 

Hope this helps, 

Message Edited by ebalci on 18-01-2010 08:45 AM
S. Eren BALCI
IMESTEK
0 Kudos
Message 6 of 7
(4,118 Views)
Okay, everything seems to be working as desired now.

Mert, I have discovered that when installing a NEW version, all the files
that were part of the OLD version are removed. That is why I got the
results I described above. However, now that my new version (which does not
include the config file) is in place, an existing config file will no
longer be removed or overwritten by a newer installation.

Eren, my earlier message gave the impression that I didn't do what Mert
suggested. But, in fact, it is my program that copies the default config
file into place if there is not one there yet. And there is no config file
in the new distribution. Sorry for that misunderstanding.

Thanks for everyones help with this. Now it's time for lunch.

    Marty
0 Kudos
Message 7 of 7
(4,081 Views)