dfmmalaw
Posts: 6
Joined: Thu Sep 03, 2020 4:04 pm

How to replace values in appsettings.json file?

Hey folks! I created an installer for a .NET Core/Angular web app and it is working fine. The installer auto configures IIS and hosts the app. Now I am having an issue. During the installation process I want to get user input (from dialog I will create) and replace the values in my appsettings.json file with the user input. I know Advanced Installer allows you to edit XML files (like web.config), but how do I manipulate the appsettings.json file without creating a custom action? Or is this the only way? I hope this question makes sense and my installer is here if you want to look at or run it.

https://drive.google.com/drive/folders/ ... sp=sharing
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: How to replace values in appsettings.json file?

Hi,

Unfortunately, we do not yet have support for handling JSON files as we have for XML files, but we are already working on this and it will be available in an upcoming version of Advanced Installer. We will update this thread when the feature will be available.

Meanwhile, you can create for example a custom action written in C# or a custom action written in C++ to update your JSON file. You may also be able to achieve this through the "Text File Update" operation.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dfmmalaw
Posts: 6
Joined: Thu Sep 03, 2020 4:04 pm

Re: How to replace values in appsettings.json file?

Thank you. Danut from your support team took me through the Text File Update and we were able to accomplish the task.... I just want to say I am so impressed by Danut and the level of customer support I received. I am going to be purchasing the Enterprise license this week solely because of the hands on support I received from Danut. It is amazing to see that customer service still exists like that today. How refreshing and uncommon. Thank you!
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: How to replace values in appsettings.json file?

Thank you very much for your kind words.

That is really very nice of you.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Catalin
Posts: 6592
Joined: Wed Jun 13, 2018 7:49 am

Re: How to replace values in appsettings.json file?

Hello,

This improvement has been added in Advanced Installer 17.7, released on November 25th, 2020.

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

Return to “Common Problems”