Link to home
Start Free TrialLog in
Avatar of luiggye
luiggyeFlag for Uruguay

asked on

How to delete a file from the setup project VB NET ?

Hi

I have a setup project in my vb net solution 2003 running OK.

I want to delete a file (if it exist) at the beginning of the setup process, (just before of the installation files).

After that, the setup can continues as normally.

How can I do it?

Thanks in advance,
Avatar of RishadanPort
RishadanPort

FileInfo MyFile = new FileInfo("...");
MyFile.Delete()
or rather...

FileInfo MyFile = new FileInfo("...");

if(myFile.Exists){
   MyFile.Delete();
}
Avatar of luiggye

ASKER

Thanks RishadanPort,

Ok, I understand that syntax, but, where I must to place it, inside my Setup project, in order to execute it before the installation files proceeds?

Waiting for your response.

Luis
Hm I am not very sure. Sorry.
Avatar of luiggye

ASKER

Hi everybody.

Its me again.

I am continuing searching for a solution, and I was found that if I create an Installer Class and connect it with a Setup Project Custom Action, maybe I can resolve my needing.

I am trying to include it in my solution, but at this moment I have not success.

The only I need is to delete some files (if it exists), just before the installation begin.

If somebody can give me a little help about it, maybe a complete but short example, I will appreciate a lot.

Thanks in advance,
ASKER CERTIFIED SOLUTION
Avatar of luiggye
luiggye
Flag of Uruguay image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of luiggye

ASKER

Finally I successfully resolved my problem (without any help from anybody) creating an Installer Class and connecting it with a Setup Project Custom Action.

I somebody wants to know how, feel free to ask me.

Thanks for nothing.

Luis
You shouldn't expect Experts to understand every problem out there.

The best thing to do, is what you did, research on your own
Avatar of luiggye

ASKER

My question was not a problem, was a common needing so easy to develop by people who wants to be called Expert.

Of course that I can resolve anything by myself, but the best thing to me, is getting some help when needed, in order to save my many.

Just like Experts Exchanges offer.
Wow you're a rude person. I am not a paid employee of EE, I am just a person who wanted to help. I don't deserve to be treated like that. I am an expert in C#, not of installation and setup of files.
Avatar of luiggye

ASKER

Sorry man.
I am not disappointed with you.
Thanks for try to help.
Bye