Page 1 of 1

Overwrite files

Posted: Mon Oct 15, 2012 1:44 am
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!

Re: Overwrite files

Posted: Mon Oct 15, 2012 10:06 am
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.

Re: Overwrite files

Posted: Tue Oct 16, 2012 12:35 am
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

Re: Overwrite files

Posted: Tue Oct 16, 2012 2:29 am
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?

Re: Overwrite files

Posted: Tue Oct 16, 2012 7:42 am
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

Re: Overwrite files

Posted: Tue Oct 16, 2012 10:25 am
by FrancescoT
Dear User,

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

Regards

Re: Overwrite files

Posted: Thu Oct 18, 2012 3:43 am
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

Re: Overwrite files

Posted: Thu Oct 18, 2012 8:14 am
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

Re: Overwrite files

Posted: Fri Oct 19, 2012 1:06 am
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

Re: Overwrite files

Posted: Fri Oct 19, 2012 11:24 am
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