MiguelOM
Posts: 12
Joined: Mon Sep 19, 2022 8:01 am

Upgrade web app

Thu Oct 27, 2022 4:36 pm

Hi,

I have been creating an installer for a web application and I have an error upgrading it. I have followed the tutorial for creating an upgrade (https://www.advancedinstaller.com/user- ... grade.html). The installer has a particularity, and it is that you install the application inside a Virtual Directory (Folder) on IIS, and the name of that Virtual Directory is called whatever the user typed through the installation. To achieve that, I have a property with a starting value "Test" and then, I let the user to choose a name for it. When I install the program the first time, everything is ok, the web app is installed on its virtual directory with the custom name, but when I try to upgrade the application, it throws an error message "Could not access network location \Test", and it makes a rollback. Would you mind to help me with it?

Thank you so much for your support.

Best Regards.

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Upgrade web app

Mon Oct 31, 2022 2:51 pm

Hello Miguel,

Most likely, this happens during the CostFinalize standard action:
CostFinalize: ends the disk space costing and resolves the folders in the project
It basically tries to resolve the folder and gives that error.

If possible, could you please try to set that property to a valid path (e.g. C:\) and let me know if that helps?

After that, if it works and if you want to progrmatically do that, you can use a "Set Property" custom action, scheduled before the "Paths Resolution" action group and set it to, for instance, [AppDataFolder] or [WindowsVolume] so we don't hardcode it in the project.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

MiguelOM
Posts: 12
Joined: Mon Sep 19, 2022 8:01 am

Re: Upgrade web app

Wed Nov 09, 2022 9:46 am

Hi!

Thank you for your support. Unfortunately, It does not work. It throws me a similar message, but now, it tells me "Could not access network location \C:\". I thought it was due to change the default value the user puts while installing, but If I leave the default value (so I understand it should find the path) it fails again.

I could prepare some sample project if you need in order to see what is happening.

Thank you in advance for your attention.

Best Regards,

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Upgrade web app

Wed Nov 09, 2022 10:57 am

Hello Miguel,

Sure, please create a sample project that reproduces this and forward that to me.

Additionally, please forward me a test-case also which I can follow in order to reproduce the behavior.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

MiguelOM
Posts: 12
Joined: Mon Sep 19, 2022 8:01 am

Re: Upgrade web app

Wed Nov 09, 2022 12:04 pm

Hi,

I send you a sample project, just removing what is unnecessary. "Sample installer" would be the first version and "Sample Installer 101" would be the second version. In order to reproduce the error, Just install the product specifying a Virtual Directory Name (Test, for example) and then, upgrade it with the 101 version specifying the same virtual directory again. It throws an error whatever name you put in Virtual Directory name, even default, that is the default value.

On the other hand, I need something else that I don't know if it is possible. In some cases (maybe Testing Environment), it could be necessary to install several instances (not only the same version, maybe different versions) into the same machine. If I make an upgrade, changing the ProductCode, and I install the application in another path (another installation), will it leave the previous installations at the same point? Will it remove or modify anything on previous installations?

Thank you so much for your help.

Best Regards,
Attachments
Sample Installer.aip
(37.58KiB)Downloaded 120 times
Sample Installer 101.aip
(37.74KiB)Downloaded 123 times

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Upgrade web app

Fri Nov 11, 2022 4:13 pm

Hello Miguel,

Thank you for providing the files.

This is currently under our investigation.

Once I will have more information about this, I will update this thread.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Upgrade web app

Mon Nov 14, 2022 2:47 pm

Hello Miguel,

As promised, here is my followup to your issue.

I have run the test and indeed it seems I encounter the same issue, too.

The problem comes from the "Set property" custom actions you have. You will encounter the same issue if you try to uninstall the 1.0.0 version too.

If you disable the "Uninstall" and "Maintenance" from under "Execution Stage Condition" for your custom actions, you will no longer encounter this behavior.
Screenshot_17.png
Screenshot_17.png (62KiB)Viewed 6160 times
On the other hand, I need something else that I don't know if it is possible. In some cases (maybe Testing Environment), it could be necessary to install several instances (not only the same version, maybe different versions) into the same machine. If I make an upgrade, changing the ProductCode, and I install the application in another path (another installation), will it leave the previous installations at the same point? Will it remove or modify anything on previous installations?
Regarding your new question, the "Side-by-side" is what you should look for:

Allow side by side installs of different product versions

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

MiguelOM
Posts: 12
Joined: Mon Sep 19, 2022 8:01 am

Re: Upgrade web app

Tue Nov 15, 2022 11:24 am

Hi!

Thank you so much for your answer. Now, it does not crash upgrading the app, but now, I have a couple of questions.

What if I want to update a file (in my case, it is a json file), but I only want to add new items, keeping old items with the same values?. I have a json with some config keys, so I have a base config that could be modified in each client. When I install an upgrade, I would like to add the new config keys with the base values, but I don't want to reset the old configurations.

When I am installing the upgrade, the default application directory is the same as the base installation ("C:\....\Test\Web" and "C:\....\Test\Reporting"). As I am using "Test" folder, it installs everything into "C:\.....\Test\Test\.....". Is there any way to set the default APPDIR without the "\Test" folder on it?

Thank you so much for your help.

Best Regards,

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Upgrade web app

Wed Nov 16, 2022 3:25 pm

Hello Miguel,

If, during an upgrade, you do not want to update an element of the JSON file, you can proceed as it follows:

- open the JSON file in Advanced Installer
Screenshot_19.png
Screenshot_19.png (37.23KiB)Viewed 4505 times

- select the node you do not want updated
Screenshot_20.png
Screenshot_20.png (25.49KiB)Viewed 4505 times
When I am installing the upgrade, the default application directory is the same as the base installation ("C:\....\Test\Web" and "C:\....\Test\Reporting"). As I am using "Test" folder, it installs everything into "C:\.....\Test\Test\.....". Is there any way to set the default APPDIR without the "\Test" folder on it?
You can set the default value of APPDIR in the "Install Parameters" page --> "Application Folder" field.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

MiguelOM
Posts: 12
Joined: Mon Sep 19, 2022 8:01 am

Re: Upgrade web app

Thu Nov 17, 2022 11:08 am

Hi,

I have tried what you explained in the last post, but it does not work for me. It keeps me overwriting the json file at all.
You can set the default value of APPDIR in the "Install Parameters" page --> "Application Folder" field.
It is the APPDIR by default, and it is ok, but when you are upgrading the application, the installer gives you the full path you used on previous installation. For example, the first time I install the app, it gives me this "C:\Program Files (x86)\Testing Installer\Testing Installer\" by default and then, I set the Virtual Directory as "Test", so the result path is the following "C:\Program Files (x86)\Testing Installer\Testing Installer\Test\". This is ok. but when I run the upgrade install, the APPDIR is "C:\Program Files (x86)\Testing Installer\Testing Installer\Test\" by default, so if I set again "Test" as a Virtual Directory, it tries to install the application at "C:\Program Files (x86)\Testing Installer\Testing Installer\Test\Test\", and it is not what I want. So, is there anythink I can set in order to use the APPDIR by default without \Test\ at the end of the path?

I send you sample installers modified so you can test by yourself. To test it, install Sample Installer, go to the installation path "C:\Program Files (x86)\Testing Installer\Testing Installer\Test\" and change the value of json file. Then , try to upgrade it with Sample Installer 101 and you will see it changes the value to 5 again.

Thank you so much for your help.

Best Regards,
Attachments
Sample Installer.aip
(41.01KiB)Downloaded 119 times
Sample Installer 101.aip
(41.48KiB)Downloaded 126 times

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Upgrade web app

Fri Nov 18, 2022 11:46 am

Hello Miguel,

It does not work, because you have not followed the steps from my last post.
Screenshot_24.png
Screenshot_24.png (27.63KiB)Viewed 4175 times
In the screenshot above, in v1, you can see that you did not uncheck that option which leads to the element being removed.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”