When the application is deployed (from the PowerBuilder IDE) or installed (from the packaged executable installer or zipped file) to the Web server, the app files and config files are generated with hash codes, to prevent files changed illegally from running. Therefore, you cannot directly change the deployed settings/files on the Web server, instead you will have to make changes in the project painter and then deploy the application again, or modify the settings/files using commands (the CustomizeDeploy.dll tool).
Note
You need to run the command as an administrator, otherwise, you may encounter the error: Access to the path 'C:\inetpub\wwwroot\salesdemo_cloud\1.01\appconfig.json.zip' is denied.
The CustomizeDeploy.dll tool allows you to:
-
Change the Web API URL -- The Web API URL (specified on the PowerServer project painter > .NET Server page) is stored on the Web server, so that the client knows where to call the PowerServer Web APIs at runtime. You may want to change the Web API URL value, if you have deployed the PowerServer Web APIs to a different server.
dotnet CustomizeDeploy.dll -url=<URL>
The "url" argument should point to the new Web API URL that you want to change to.
dotnet CustomizeDeploy.dll -url
If the "url" argument is not set with any value, it will get the current URL.
-
Change the External Files -- The "External Files" refers to the packages, folders, and files (such as INI files, DLL/OCX etc.) that are deployed from External Files in the PowerServer project painter > Client App page.
dotnet CustomizeDeploy.dll -src=<source file> -dest=<destination file>
The "src" argument should point to the new file that you want to use to replace the old file. The "dest" argument should point to the old file that you want to replace with the new file.
-
Encrypt the password -- You can encrypt 1) the database login password used in the PowerServer project painter > Database page, or in the PowerServer C# solution > ServerAPIs project > AppConfig > Applications.json file, or 2) the proxy server password in the PowerServer C# solution > ServerAPIs project > Server.json file > "ProxyOptions" block. You can use the encrypted string instead of the plain-text string to protect sensitive information.
dotnet CustomizeDeploy.dll -encrypt=<string>
The "encrypt" argument should be set to the value that needs to be encrypted.
dotnet CustomizeDeploy.dll -encrypt=<string> -outfile=<output file>
The "outfile" argument can save the encrypted value in the specified location and file.
The CustomizeDeploy.dll tool can be found in two locations:
-
In the Web server: %WebRoot%\[appname]\[version]\CustomizeDeploy.dll
To execute the CustomizeDeploy.dll file located on the Web server, you will need to install the ASP.NET Core Runtime 3.1 or later first.
You can execute this file to change the Web API URL, change the external files, and encrypt the password.
-
In the PowerBuilder IDE installation folder: %AppeonInstallPath%\PowerBuilder [version]\Pstools\CustomizeDeploy\CustomizeDeploy.dll
To execute the CustomizeDeploy.dll file located in the PowerBuilder IDE installation folder, there is no need to install the ASP.NET Core Runtime as it is already installed with PowerServer Toolkit.
You can execute this file to encrypt the password.
To run CustomizeDeploy.dll in Windows Web server:
-
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 > [appname] folder > [version] folder (for example, C:\inetpub\wwwroot\salesdemo_cloud\1.01).
-
Execute the CustomizeDeploy.dll file using the dotnet command.
To run CustomizeDeploy.dll in Linux Web server:
-
Install the ASP.NET Core Runtime 3.1 or later.
dnf install aspnetcore-runtime-5.0
-
Go to the Web server root folder > [appname] folder > [version] folder (for example, /var/www/html/salesdemo_cloud/1.01, or /usr/share/nginx/html/salesdemo_cloud/1.01).
-
Right click the blank area within the folder and then select Open in Terminal.
-
Execute the CustomizeDeploy.dll file using the dotnet command. Notice that the command and file name are all case-sensitive in the Linux OS.