LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

uninstall exe when app exits

Has anyone written an app that will un-install or otherwise disable itself when the user exits?

We have a requirement that software must be installed each time it is used, and since the procedure to do this may be ignored , and existing software run again, we need some way to uninstall.

The first thing that comes to mind is to call the uninstall script from using the system exec in my 'exit' state.

Thanks for your inputs!

Rick
0 Kudos
Message 1 of 5
(2,409 Views)
Could you define 'install', a labview executable doesn't need to be installed, so you could create a command to delete it's own executable (be aware you don't test this during development or LabVIEW.exe will be gone)

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 5
(2,407 Views)
Thanks, historically we have sued a batch file to 'install' the exe and support files to their required locations, and then remove them when the app exits. I prefer to use an installer to perform the same 'install' parts of this, but you can't tell the installer to then run the uninstall when the app exits. I was just wondering if anyone else has had to solve this problem before.

Even though a LabVIEW exe doe not have to be installed in the traditional sense of the word, we sometimes (increasingly) use the installer to install the environment like DAQ, CAN, etc. Using the batch file technique to do this can become complicated.
0 Kudos
Message 3 of 5
(2,406 Views)
Hi Rick,
 
There has been a Corrective Action Request filed concerning this matter (CAR #3TAB8S00), as this functionality was available in previous versions of LabVIEW.
 
Here is a proposed workaround that was utilized by another customer:
 
Look for a key named UninstallString. The key holds a value that Add\Remove Programs executes when you click "Remove". You can execute the UninstallString from a command line or programmatically. I have pasted an example below. I use Windows XP Professional, so the key path may vary. HTH

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\
9040110900063D11C8EF10054038389C\InstallPropertiesDisplayName: Microsoft Office Professional Edition 2003

UninstallString: MsiExec.exe /I{90110409-6000-11D3-8CFE-0150048383C9} <-
You can execute this from the command line.

You could potentially write a VI to read through the registry and find UninstallString for the program you'd like to remove. Then you call the MsiExec.exe as above from the LabView command System Exec.vi to send the command line.
 

 
Amanda Howard
Americas Services and Support Recruiting Manager
National Instruments
0 Kudos
Message 4 of 5
(2,367 Views)
I don't think you can uninstall and EXE while the EXE is running. You may want to execute a batch file upon the closing of the program.



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 5 of 5
(2,357 Views)