Solved

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

Posted on 2008-06-25
14
711 Views
Last Modified: 2012-08-14
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,
0
Comment
Question by:luiggye
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
14 Comments
 
LVL 6

Expert Comment

by:RishadanPort
ID: 21870487
FileInfo MyFile = new FileInfo("...");
MyFile.Delete()
0
 
LVL 6

Expert Comment

by:RishadanPort
ID: 21870490
or rather...

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

if(myFile.Exists){
   MyFile.Delete();
}
0
 

Author Comment

by:luiggye
ID: 21873595
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
0
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
LVL 6

Expert Comment

by:RishadanPort
ID: 21881414
Hm I am not very sure. Sorry.
0
 

Author Comment

by:luiggye
ID: 21885734
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,
0
 

Accepted Solution

by:
luiggye earned 0 total points
ID: 21886648
Hi everybody.

Its me again.

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

0
 

Author Comment

by:luiggye
ID: 21886656
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
0
 
LVL 6

Expert Comment

by:RishadanPort
ID: 21886730
You shouldn't expect Experts to understand every problem out there.

The best thing to do, is what you did, research on your own
0
 

Author Comment

by:luiggye
ID: 21886808
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.
0
 
LVL 6

Expert Comment

by:RishadanPort
ID: 21888351
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.
0
 

Author Comment

by:luiggye
ID: 21888371
Sorry man.
I am not disappointed with you.
Thanks for try to help.
Bye
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question