1. Michael Doescher
  2. PowerBuilder
  3. Tuesday, 25 July 2023 17:39 PM UTC

Hi, I have a problem with customizing the runtimepath in the application.xml when deploying with the web deployment.

We still build our application normally but hope to be able to deploy via web deployment (CloudAppLauncher) for some customers soon.

When building our application normally, PowerBuilder gives us the possibility to change the runtimepath. According to our internet research, we are officially allowed to add multiple paths to the runtimepath.

<Application>

    <RuntimePath>runtime;anotherruntime</RuntimePath>

</Application>

In the web deployment we can’t find any possibility to set anything and powerbuilder creates its own xml. Even if we try to change the application.xml after it is downloaded through CloudAppLauncher, it is automatically changed back to the one that PowerBuilder has created when the application is started.

How can we get PowerBuilder to take our addition runtimepaths?

We would appreciate any help here.

Thank you

Mike

Miguel Leeuwe Accepted Answer Pending Moderation
  1. Friday, 28 July 2023 13:01 PM UTC
  2. PowerBuilder
  3. # 1

As an alternative, we don't use any batch or cmd files.

Right after opening the application at startup, we have the code of our application get the current PATH and then prepend it with the extra PATHs that we need. Only works for the current session.

To achive this goal, we use the API functions

function boolean GetEnvironmentVariableW(ref string lpName, ref string lpBuffer, ref ulong nSize) library "KERNEL32.DLL"
function boolean SetEnvironmentVariableW(ref string lpName, ref string lpBuffer) library "KERNEL32.DLL"

For this to work, in our shortcut the "start in" folder has to be set to where the pbruntime dlls are. In our case it's a subfolder of where the EXE is. The shortcuts are created by our installer program (wix installer).

regards

Comment
There are no comments made yet.
Michael Doescher Accepted Answer Pending Moderation
  1. Tuesday, 25 July 2023 19:17 PM UTC
  2. PowerBuilder
  3. # 2

Hi Chris,

or is there a way to add in the PowerClient "External Files", files from a subfolder directly into the application folder? It alway creates the subfolder that the files are in. Our problem is that we have all of our additional files, that need to be in the application folder, in a sub folder. When deploying normaly, we can, if needed, move with our own deployment, these files into the application folder. In the web deployment, this is not possible without changing everything and moving everthing into the target folder. We realy do not want to do this.

We hope you can help us.

Kind regards

Mike

Comment
There are no comments made yet.
Michael Doescher Accepted Answer Pending Moderation
  1. Tuesday, 25 July 2023 19:06 PM UTC
  2. PowerBuilder
  3. # 3

Hi Chris, thank you for answering so fast.

Yes, we tried it out and research this online if it's allowed. We don't remember where we found the answer, either in the community or in stackoverflow, but someone said that deep down in the documentation that this is aloud.

So, we reorganized a lot of the things that needed to be in the exe folder and put it in a sub folder. We then changed the setting in the deployment for the exe to two sub folders, runtime and our other and it created the exe with the xml perfectly. It works great and we love it.

The problem now is that we want to deploy also with the web deployment. There we can’t set anything that would influence the xml file. When we get in between manually after the web deployed exchanges the xml and change it to the one we would like to have, it works again perfectly.

Is there any chance to for us to exchange the xml when deploying via web deployment (CloudAppLauncher)?

Or is there another way to clean up our exe folder and have things search in a sub folder like the runtime?

Kind regards

Mike

Comment
  1. Michael Doescher
  2. Wednesday, 26 July 2023 18:23 PM UTC
Hi Chris,

I'm sorry but I might be stupid right now because I don't understand.

I wanted to change or add to the runtimepath so the files in the subfolder would be automaticly found.

If I can't add or change the runtimepath in the xml, then the files need to be in the same folder as the application.

When I use the "Add Folder" option in the PS Project's external files, the folder is added and the files are not in the application folder.

The files can't be found and I need again the change or added sub folder into the runtimepath of the xml.

The only way I know now is to add all the files to the target folder, so they can be added directly without any folder into the application folder.

This is but what we don't want to have to do.

I there any alternative?

Thank you for giving me your time and effort.

Mike
  1. Helpful
  1. Michael Doescher
  2. Friday, 28 July 2023 09:03 AM UTC
Hi, I found a solution.



We deploy, via web, our additional runtime files in a subfolder <additionalruntime>, just like we do with our normal deployment. Now because we can not change the runtimepath in the xml file, we added a "init.cmd" file to our <additionalruntime> subfolder.



init.cmd

cd additionruntime

xcopy *.* ..\*.*



This copies all files into the application folder.



Then we let the application run this cmd when the application starts for the first time and when an updated was performed.



"RunOptions": { .. PreloadEvent": { "Commands": "additionalruntime\\init.cmd", ...



I still would perfer to add <additionalruntime> to the runtimepath.



Thank you for your support Chris.



Kind regards

Mike
  1. Helpful
  1. Chris Pollach @Appeon
  2. Friday, 28 July 2023 12:19 PM UTC
Hi Mike;

You are most welcome! ;-)

Thank you for the great feedback & news on your success!

Please feel free to open an enhancement request support ticket for amending the runtime path option.

Regards... Chris
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 25 July 2023 18:26 PM UTC
  2. PowerBuilder
  3. # 4

Hi Michael;

  The RuntimePath in the <AppName> XML file is only used by the App EXE to locate the PB runtime at start-up. Nothing else.

   Are you looking to add more paths for the App to use besides the PB runtime?

Regards ... Chris

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.