/build/static/layout/Breadcrumb_cap_w.png

Delete File prior to install

I want to delete a file prior to the install / reinstall.

I have an app that has 4 config files. and i have it set up as with conditions for the components.

During app install depending on which "flavor" is being installed im passing a parameter to the msi.

Var="Site1"
Var="Site2"
Var="Site3"


Now, if lets say someone at site 1 gets site 2 cfg file i want to just simple reinstall the app over the top
and make sure i get the site2 cfg file.

So what i was thinking, seting up a custom action vbs

If file esxists delete
i have the vbs already working

but i run into a problem where it just deletes the file and it never puts it back on :(


Return processing: Synchronous (Ignore Exit code)
In-script Execution: Deferred Execution
Install Exec Sequence: After InstallInitialize


So you would think that it would delete the file that is there, and then proceed with the install and copy the new file down every time
even on a repair/reinstall.


Install Shield 2009 / Admin Studio

0 Comments   [ + ] Show comments

Answers (6)

Posted by: Enes 14 years ago
Senior Yellow Belt
0
To simplify it:

What are the custom action settings if i want to:

delete file prior to the install of the application if it exists,

install the updated file as part of the package
Posted by: turbokitty 14 years ago
6th Degree Black Belt
0
Have you verified the file will come down on a machine without the file already existing, that is, are you sure your little variable dance there is working?
Verbose log?
You can use the "Override system version" option on the file you're bringing down as well. I admit, I've had mixed results in the past with that, but it might work for you.
Posted by: elgwhoppo 14 years ago
Senior Purple Belt
0
Does your custom action come before the InstallFiles action? It should.

You might be deleting the file too late in the process.
Posted by: anonymous_9363 14 years ago
Red Belt
0
You're making things W A Y too complicated. Use the RemoveFile table. http://msdn.microsoft.com/en-us/library/aa371201%28VS.85%29.aspx

AFAICR, InstallShield has a UI for file deletion, to save you having to work out how to use the table.
Posted by: elgwhoppo 14 years ago
Senior Purple Belt
0
ORIGINAL: VBScab

You're making things W A Y too complicated. Use the RemoveFile table. http://msdn.microsoft.com/en-us/library/aa371201%28VS.85%29.aspx



This might even be a candidate for a sticky! LOL, so many questions are answered by that link.
Posted by: anonymous_9363 14 years ago
Red Belt
0
First, a post which repeats my advice almost 24 hours after my original and now a post advising the use of a script! A script is completely unnecessary. Look at the sequence: the RemoveFiles action (which reads the RemoveFile table) is executed some time before InstallFiles.

Please, make sure your advice is valid before posting, especially to new packagers. This junk is hard enough to get one's head around without being sent off in completely spurious directions.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ