Overwrite files

Got a problem you cannot solve? Try here.
Post Reply
lbertoldi
Posts: 55
Joined: Wed Apr 07, 2010 7:19 am

Overwrite files

Post by lbertoldi »

Hi, I got a problem upgrading a web application.
As a web application, it is mainly based on unversioned files I need to overwrite when upgrading. By "upgrading" I mean that if NEEDSUPGRADE=TRUE I do not want to uninstall the old application files (this can lead to IIS problems) but rather overwrite them.
I tried with the "Reset file date plugin" with no success.

I am attaching a sample project. Build it and install it once, change the empty.txt file contents in the source folder, build and install again. The file is not overwritten with the latest version, even though its date is correctly reset.

Is the plugin compatible with IA 2012? Is there another way I can overwrite files? I mean, without having to manually delete the files in the target folder.

Thanks!
Attachments
IA_Test.zip
(374.73 KiB) Downloaded 570 times
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Overwrite files

Post by FrancescoT »

Dear User,

I will try your project as as possible.

By the way, an upgrade executed using MSI engine requires previous version unistallation to work correctly, otherwise it will fail.
You could try to use InstallAware NATIVE ENGINE feature to create a setup packages that runs independently from MSI, in this case you could do as you like.

Alternatively, you could try to to use Native Engine just when installing that file, for example;

Code: Select all

Set Variable NATIVE_ENGINE to TRUE
Install File xxxxxxx
Set Variable NATIVE_ENGINE to FALSE
In this case the file installation is not placed in MSI database but executed immediatelly ... and the file should be removed.

Regarding the plugin compatibility question, I suppose it is compatible with IA 2012, but for a sure answer you should contact the vendor directly.

Regards.
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
lbertoldi
Posts: 55
Joined: Wed Apr 07, 2010 7:19 am

Re: Overwrite files

Post by lbertoldi »

Thanks for you quick reply, as usual!
Unfortunately, I cannot uninstall the previous version as this will remove all the web files and IIS cfg.
I will try your suggestion (I didn't think I could switch to native code on the fly!), but does this in any way invalidate Windows Compliance?
Thanks
lbertoldi
Posts: 55
Joined: Wed Apr 07, 2010 7:19 am

Re: Overwrite files

Post by lbertoldi »

No luck.
I tried your suggestion on the previously attached project but it doesn't work. I also tried setting NATIVE_OVERWRITE=TRUE.
Are you sure I can switch to/from native engine on the fly?
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Overwrite files

Post by FrancescoT »

Yes, I'm sure.
This will not have any other conseguences if you switch it back to OFF just after the command.

The NATIVE_OVERWRITE I believe have nothing to do with your needs.

I will try to see what happen using your files.

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Overwrite files

Post by FrancescoT »

Dear User,

Please use the attached project that demostrates how to keep a file during uninstall.

Regards
Attachments
lbertoldi.zip
(363.58 KiB) Downloaded 558 times
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
lbertoldi
Posts: 55
Joined: Wed Apr 07, 2010 7:19 am

Re: Overwrite files

Post by lbertoldi »

Hi Francesco,
thanks for your support but I see I did not explain an important point: the application is already installed (I already have an old Installshield setup and a newer IA one) so I need to overwrite files that have been copied MSI-style.
Also, Permanent is not an option, the uninstall process should remove all the files.
Any more ideas?
Thanks
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Overwrite files

Post by FrancescoT »

Dear User,

Probably I am really lost!

Why don't you use the NATIVE ENGINE approach to overwrite the file?

Obviously, if you want to remove it during uninstall, you should forcibly remove it using "Delete Files" command (within NATIVE ENGINE ON/OFF block as well).

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
lbertoldi
Posts: 55
Joined: Wed Apr 07, 2010 7:19 am

Re: Overwrite files

Post by lbertoldi »

I am attaching a new sample, using the NATIVE_ENGINE approach you suggested.
1. build the package and install
2. on the target machine, change the empty.txt file contents in any way
3. build again and install
---> the file is not overwritten
4. uninstall the package
---> the file is not removed (I assume the reason is that Apply uninstall is MSI related while the file has been copied using the native engine, as you wrote in your last post)

To recap, I need to be able to
- overwrite existing files
- delete them on uninstall WITHOUT deleting any additional content the end user could have placed in the folders
- last but not least, I need to perform these tasks without having to handle each file separately

Hope my problem is clearer now.
Thanks
Attachments
IA_Test.zip
(364.93 KiB) Downloaded 591 times
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Overwrite files

Post by FrancescoT »

Dear User,

I have already provided you with all the necessary informations to that ... obviously if files installation is not managed by MSI engine you must handle each file copy and removal separately, unless you don't use a folder just for that.

Of course as default with MSI engine, any additional content the end user could have placed in the folders will be not removed during unistall.

I will try as soon as I can, to have a look at your project.

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Post Reply