PC Review


Reply
Thread Tools Rate Thread

How to delete folder prior to install if exists

 
 
Finn Stampe Mikkelsen
Guest
Posts: n/a
 
      15th Mar 2011
I have a solution with several projects, where i have added a setup project. this works great for me.

But now i have a situation, where i need my installer to check if the application folder already exists and if so, i need to delete it all of its files and sub-directories..

I have tried with a costum action, but have so far only gotten errors when trying to run the setup. The installer class has been targeted to the same framework and cpu, but i get an error 1001 with an access violation to the costumaction.dll...

Can anybody either direct me to an understandable tutorial og better yet, maybe try to explain with code snippets how to accomplish what i need?

TIA

/Finn
 
Reply With Quote
 
 
 
 
Finn Stampe Mikkelsen
Guest
Posts: n/a
 
      17th Mar 2011
"rossum" skrev i meddelelsen news:(E-Mail Removed)...
>/Finn
>As a general principle you should not delete the old folder until you
>are sure that the new folder is correctly installed. You need to be
>able to leavy the machine unchanged if the installation fails for any
>reason.
>
>One possible way is:
>
>1 Remane the existing folder to a temporary name.
> 2 Install new solution.
> 3 Test for correct installation.
> 4 If installatin succeeded then delete the temporary folder.
> 5 If the installation failed then delete the new installation folder,
>roll back any other changes and rename the temporary folder back to
>its original name.
>
>rossum


I've played around with it now and i believe i've found a workable solution. What i needed was to be able to delete 2 residual files
left over from an uninstall of a previous version install of the software. I figured it would be easier to just delete the install
folder prior to install, but i ended up with examining the folders and checking if these 2 files where present. If so, i delete
them..

This seems to work fine. As these files are not needed even if the install fails, i have no problem with them comming back if it
does. I have however placed the actual code to delete the files in the commit section of the CostumInstall, so it should not be a
problem..

Thanks for your input.. ;-)

/Finn


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Test if folder exists prior to creating it - VBA Isissoft Microsoft Access Getting Started 5 6th Jul 2008 06:24 PM
Dropdown List - Check if value exists in list prior to selection =?Utf-8?B?QnJlbmRlbiBCaXhsZXI=?= Microsoft ASP .NET 5 20th Mar 2007 11:05 PM
Checking to see that a CHART exists prior to running a simple command Anton Microsoft Excel Misc 0 29th Aug 2006 06:30 AM
What program do I install to install office 2003 with no prior pro =?Utf-8?B?bHdk?= Microsoft Excel Misc 1 8th Jan 2006 09:37 PM
Will repair install delete My Documents folder and other user files? Gautam Bhagwandas Windows XP Setup 2 5th Nov 2003 10:12 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:35 PM.