Can't overwrite file

Got a problem you cannot solve? Try here.
Guest

Can't overwrite file

Postby Guest » Tue Apr 25, 2006 11:57 am

I've got an issue where a certain file in my installation might already exist. If it does, I want to overwrite it with the file included in the install. However, it isn't being overwritten. I'm not sure what I'm doing wrong but here is an example project.

To recreate:
Install.
Copy the only file it installs (temp.tmp) to the same directory; so there is "temp.tmp" and "copy of temp.tmp" in the same directory.
uninstall.
rename "copy of temp.tmp" to "temp.tmp" and change the contents of the file so you can know if it was replaced.
Install again.

The second install appears to work normally but temp.tmp never gets overwritten with a fresh copy. It still has my changes in it. What am I doing wrong?

File Attached:

My Installation Project.mia

jimo
Posts: 342
Joined: Fri Aug 19, 2005 10:59 am
Location: Atlanta, GA
Contact:

Postby jimo » Tue Apr 25, 2006 12:37 pm

If you double click the Install Files command for the file tmp.tmp in the code editor are there any check boxes marked?

And, the beset way is to inlcude the *.mpr file with the *.mia file in a zip so we can open the project.
Jim Oswell
Software Engineering Manager, Dental
Greenway Health, LLC
http://greenwaymedical.com

Guest

Postby Guest » Tue Apr 25, 2006 1:51 pm

No boxes are checked.

File Attached:

My Installation Project.zip

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Tue Apr 25, 2006 3:44 pm

Windows Installer internally manages overwrites. So what you want to do is make sure your file has a newer version, or if that is not possible (like a plain text file), a newer date. Then the overwrite will happen automatically.

If you would like to force an overwrite, you can do that too. Just delete the file manually before installing the new copy. You can use the DeleteFileA API in kernel32.dll with the Call DLL Function plug-in to do this.
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 150 guests