By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,903 Members | 1,977 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,903 IT Pros & Developers. It's quick & easy.

Deleting a custom action file after it has run

P: n/a
Hello,

I'm not sure if this is precisely the correct newsgroup for this, so I
apologize if it isn't..

Scenario: a WinForms app written in VS.NET 2005 (C#) and installed via a
Setup and Deployment project.

This is an upgrade of an old VB6 app which used the Registry to persist
certain data, but the C# app doesn't use the Registry - it uses the
Properties Settings.settings functionality instead.

Because I couldn't find any way in the standard Setup & Deployment project
to read values from the Registry and then copy them into the new
Settings.settings file, I wrote a small C# executable to do this instead,
which I set as a Custom Action in the Setup & Deployment project.

This is working correctly. The whole thing is packaged as an MSI. When it
runs, the upgrade executable is deployed along with the main app's files,
and is run at the end of the installation process. The resulting folder
looks something like this:

<MyApp>
MyApp.exe
MyApp.exe.config
MyApp.ico
MyApp_Upgrade.exe

What I would like to do now is have the MSI delete the MyApp_Upgrade.exe
file after it has run it, but there doesn't seem to be any way of doing this
in the Setup & Deployment project.

Curiously, if I delete it manually (or even have the main app delete it), it
gets recreated every time the app is run if the MSI is still on the machine!
I'm presuming there's some sort of setting for this which I have missed?

I should point out (in case anyone wonders) that the only reason I have for
wanting to do this is purely cosmetic / aesthetic... Leaving the
MyApp_Upgrade.exe in the application's installation folder causes no
problems whatsoever. But I would like to delete it because it's no longer
required.

Does anyone know of any way to do this?

Thanks,

DJ
Jun 22 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.