After deploying the client app to the Web server, the end user will need to double check that the Web API URL is correct.
The end user can also replace the external files (such as INI, images etc.) on the Web server.
The client app needs to know where to access the PowerServer Web APIs when it starts to run.
After the application is deployed to the Web server, the end user can check and change the Web API URL using the command-line tool (CustomizeDeploy.dll) which is located in the "[version]" sub-folder of the application folder on the Web server.
To change the Web API URL for a deployed application:
-
Install the ASP.NET Core Runtime 3.1 or later.
-
Open the command prompt. (You'd better run the command prompt using an administrator by right-clicking it and then selecting "Run as administrator").
-
Navigate to the Web server root folder > [application] folder > [version] folder (for example, C:\inetpub\wwwroot\salesdemo_cloud\1.01).
-
Execute the CustomizeDeploy.dll file using the dotnet command.
To get the current URL:
dotnet CustomizeDeploy.dll -url
To change the URL:
dotnet CustomizeDeploy.dll -url=<URL>
The "url" argument should point to the new Web API URL that the end user want to change to. If the "url" argument is not set with any value, it will get the current URL.
For example
After the application is deployed to the Web server, the end user can change the external files using the command-line tool (CustomizeDeploy.dll) which is located in the "[version]" sub-folder of the application folder on the Web server.
The "External Files" refers to the packages, folders, and files (such as INI files, DLL/OCX, images etc.) that are configured on the External Files tab of the PowerServer project painter.
To replace the External Files for a deployed application:
-
Install the ASP.NET Core Runtime 3.1 or later.
-
Open the command prompt. (You'd better run the command prompt using an administrator by right-clicking it and then selecting "Run as administrator").
-
Navigate to the Web server root folder > [application] folder > [version] folder (for example, C:\inetpub\wwwroot\salesdemo_cloud\1.01).
-
Execute the CustomizeDeploy.dll file using the dotnet command.
dotnet CustomizeDeploy.dll -src=<source file> -dest=<destination file>
The "src" argument should point to the new file that the end user wants to use to replace the old file.
The "dest" argument should point to the old file that the end user wants to replace with the new file.
When external files are deployed to the server, they are appended with the file extension ".zip", but they are not compressed files (the only exception is package). For example, if apisetup.ini is selected in the External Files tab, it will be deployed as apisetup.ini.zip to the server, however, apisetup.ini.zip is not a compressed file and it can be directly opened in a text editor just like apisetup.ini.
And to replace the file, the end user should prepare the source file without .zip extension.
For example,
dotnet CustomizeDeploy.dll -src=/new/apisetup.ini -dest=apisetup.ini.zip
Or
dotnet CustomizeDeploy.dll -src=/new/new.ini -dest=apisetup.ini.zip
The only exception is the package which is indeed compressed as the zip format (with file extension ".zip.zip"). Therefore, the end user should prepare the source file for the package in the compressed zip format.
For example,
dotnet CustomizeDeploy.dll -src=/new/theme.zip -dest=theme.zip.zip
Or
dotnet CustomizeDeploy.dll -src=/new/aaa.zip -dest=theme.zip.zip
The tool will replace the package as a whole (and refresh the hash code of the package) and it will not validate the individual files included in the package. Therefore the end user needs to make sure the files included in the package are correct and complete.
Note
Double check that the source files are NOT read-only before replacement, otherwise you may have this error at runtime: "Access to the path C:\inetpub\wwwroot\testapp\1.01\cp.ico.zip' is denied."