LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Remove custom files on uninstall

LabVIEW gives us lots of nice customisable features in the application builder, allowing us to create installers that look robust and professional.

 

However, I recently received a minor complaint from a customer that my application left files behind when uninstalled from his system. The files he's referring to are files that are stored in the %ALLUSERSPROFILE% folder, as recommended for storing application-specific files. The uninstall (Add/Remove Programs > My App) clearly isn't aware of the files my application creates, and I wouldn't expect it to be either.

 

One day I might find myself needing to ensure these are entirely cleaned from the customers system upon an uninstall. So - how can one go about engineering a customised uninstall procedure for one's LabVIEW applications?

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 1 of 13
(4,653 Views)

Hi Thoric,

 

Good afternoon and thanks for your post. Sorry for the delay - but I read your post yesterday. However I was out of the office and wanted to check a few things up for I replied. 

 

I am fairly sure that this functionality is not presently possible in LabVIEW Application Builder.I have found a product suggestion on something similar to what your suggesting.

 

As a workaround,I was thinking you could create a custom-created batch file that invokes the msi files for the additional installers in order to uninstall them one-by-one. You could put this on the Start menu under your app and have it appear as an ordinary program called "Uninstall". You could also have write an exe (to be called as part of the batch file) to delete files created by your application - if the paths are constant for all your users.

 

What do you think, I'd like to discuss this further with you! 

 

Hope this finds you well, .. does anyone have anything to suggset?

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
Message 2 of 13
(4,616 Views)

Hi Thoric,

 

I have just had a think with someone else at NI UK (another James!) and we had another idea.

 

The solution above obviously wouldn't work for Add/Remove.

 

Now the following hasnt been tested - but if you could try it - we'd be interested in the results.

 

In the Installer Properties during the build, under Source Files you have a list of folders under the Destination View. Now if you add a folder under for example CommandAppDataFolder and direct all your additional files to install there - just like %ALLUSERSPROFILE%. The thinking is that when you uninstall using Add/Remove the installer will be aware of the folder and remove it. 

 


 

Just a suggstion, please let me know if you're willing to try it?

Message Edited by Hillman on 04-08-2009 06:05 PM
Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
Message 3 of 13
(4,610 Views)

Hi James (and the other James too!) Smiley Very Happy

 

I had thought of the batch-script idea, but came to the conclusion that it wouldn't be easy to make the batch script delete itself at the end of the procedure. Plus, as you identified, this does rely on the user not using Add/Remove Programs, which you can never guarantee.

 

In the installer, CommonAppDataFolder redirects to ApplicationData, according the LabVIEW help, which is what I'm using already of course, so it sounds like it should work out for me. I created a test application and an installer, and asked the installer to create the folder "TestFolder" in CommonAppDataFolder. However, the installer didn't create the folder Smiley Sad . So I asked my application to programmatically create the folder and place a file into it. I then uninstalled the application, but the folder remained. It seems the installer was not aware of the folder because it itself didn't create it, and therefore didn't care to remove it upon uninstall.

 

How do I get the installer to create this folder I need in ..\Application Data?

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 4 of 13
(4,588 Views)

Ok, so I tried the obvious, and asked the installer to place a file into the folder, which forced it to create the folder correctly 🙂

 

But now I have good and bad news. If I instll my application, then immediately uninstall it, the uninstaller removes the folder within ApplicationData. Huuray! 🙂
But, if my application creates any files within this folder, the uninstaller leaves those files untouched, and remove only the one file it copied into there itself. This of course also leaves the folder intact too. Boo! 😞

 

So, no luck. The installer (perhaps rightfully) leaves behind any files it doesn't feel it has authority to remove, and removes only those files that it created itself. Therefore, my application files will always remain.

 

Any more ideas?

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 5 of 13
(4,586 Views)

Hi Thoric,

 

Good afternoon and I hope your well today. I hope you had a good Easter break.

 

Another double James - to be fair - the other James has most of these ideas  :smileytongue:

 

So it does certainly appear to come down to a permission issue.. but there is still one more aspect of the installer process, maybe the install hasn't made a note to remove files from the folder location.. and hence when user data is created it doesn't remove the files (and hence not the folder). Several installers place placeholder text files (placeholder.txt) in added folder locations and maybe this is to allow them to remove files upon an uninstall. 

 

So if you create a placeholder.txt (blank) file and add it to the project >>  Right click My computer>>Add>File.. and add the text file. The in the installer options create the MyAppData folder but then in the folder (Source Files tab on the installer build) drag into the Folder the placeholder.txt. Does this allow you to remove the user data?

 

Screenshoot to show suggestion:

 

 

Otherwise, we maybe lead to the batch solution with a custom uninstall.. but maybe I can contact R&D.. we shall see. I'd first be interested in the results of the palceholder.txt suggestion.

 

Hope this helps, 

Message Edited by Hillman on 04-14-2009 02:18 PM
Message Edited by Hillman on 04-14-2009 02:19 PM
Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
Message 6 of 13
(4,543 Views)

Afternoon James,

 

Nope, that didn't work either. The placeholder.txt file was removed only.

Any more ideas? Smiley Indifferent

 

Message Edited by Thoric on 04-14-2009 04:28 PM
Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 7 of 13
(4,529 Views)

Hi Thoric,

 

Good Morning and I hope your well today.


I contacted R&D and AE colleagues in the states, and discussed the issue you were having.

 

Outcomes:

 

1. This is expected behavior, since the installer does not know about those files - as we have discussed.

2. LabVIEW expert has verified that there currently is no good way to create a custom installer which would remove these files.  Unfortunately, the only method they could think of was to use a batch file - which we have already considered. 

 

Summary:

 

1. Please file a product suggestion for this feature:

 

Product Suggestion Center 

http://digital.ni.com/applications/psc.nsf/default?OpenForm

 

Other Suggestion:

 

In the meantime, you could build the executable in LabVIEW, and then purchase a third party installer. You should be able to find one that allows you to customize the uninstaller.

 

So it seems we've run the issue to the end - but if you could let me know your thoughts on the final outcome that would be great!

I hope you've found the support helpful, friendly and prompt - and I wish you all the best with all your applications. 

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
Message 8 of 13
(4,508 Views)

Morning James,

 

Thanks for the support and suggestions. The outcome is a little disappointing, I wish I could say I wasn't expecting this, but it did seem futile from the outset I suppose.

 

I've submitted a product suggestion, which I hope will be considered with gravity.

 

Is it possible to purchase and use Install Shield (which I believe LabVIEW uses, right?) to modify the installation files after LabVIEW has created them? And thus edit the uninstallation scripts to include a removal of any directories/files I choose to remove? I have no experience with installation creation tools so I don't know if this is possible

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 9 of 13
(4,496 Views)

Hi Thoric,

 

you can have a look at the Nullsoft install system (open source). I used it some time ago with a nice editor to create the scripts.

It's quite powerful and flexible. Regarding your specific need, I've seen installers made with this system that ask whether to keep or delete user files when uninstalling the application (was it FileZilla?). The downside is, it's quite a bit more complicated to use than the standard LV installer.

 

Hope this helps,

Daniel

 

Message 10 of 13
(4,493 Views)