is it possible to set the Properties to javascript file - Advanced Installer Community
apachemaven
Posts: 10
Joined: Wed Jul 11, 2012 10:29 am

is it possible to set the Properties to javascript file

Hi:

I have a javascript file like this:

......
var serverIP="http://localhost:8080";
......



Now I want to repalce the `localhost` to the IP address of the server(the application to be installed).

But I found that I can only set the properties to xml.

Is it possible to modify the js?
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: is it possible to set the Properties to javascript file

Hello,

In order to achieve that you can use a Text File Update using a “Search & Replace” operation.

First you can have a search location's folder in which your file is located. In order to search for a folder path you can go in the “Search” page and use the [New Search Wizard] toolbar button and follow step-by-step wizard directions. The result of your search will be stored in a public property(e.g. FOLDER_SEARCH_RESULT ).

In the “Files and Folders” page, you can add a “Property based folder” which uses a custom property, the search result.

In this folder you can add your Text File Update.

If you have any questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
landon
Posts: 2
Joined: Wed Jan 11, 2023 9:47 am

Re: is it possible to set the Properties to javascript file

Dan wrote: ↑Thu Jun 27, 2013 4:33 pm Hello,

In order to achieve that you can use a Text File Update using a “Search & Replace” operation.

First you can have a search location's folder in which your file is located. In order to search for a folder path you can go in the “Search” page and use the [New Search Wizard] toolbar button and follow step-by-step wizard directions. The result of your search will be stored in a public property(e.g. FOLDER_SEARCH_RESULT ).

In the “Files and Folders” page, you can add a “Property based folder” which uses a custom property, the search result.

In this folder you can add your Text File Update.

If you have any questions, please let us know.

Best regards,
Dan
Can you provide a demo, I also encountered this problem, when packaging the vue project, I want to replace the vue js file by entering the api interface address through a dialog box
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: is it possible to set the Properties to javascript file

Hello,

I'm afraid I am not quite sure what you are trying to achieve here.

Would you like to input in the dialogs the path to the Vue file and then have it replaced entirely?

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

Return to “Common Problems”