1. Avory Rose Pastoral
  2. PowerBuilder
  3. Tuesday, 3 September 2019 07:10 AM UTC

Hi Everyone,

I have created customize theme inside theme190 folder and named it "Flat Design Purple". During development everything run smooth but after deployment the theme is not working anymore. I have put the "theme190" folder in the root folder of my exe but the theme still not working. Also, upon deployment windows classic style is not checked. So I didn't know which part i missed. Please help. Thank you!

Accepted Answer
Ken Guo @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 4 September 2019 04:01 AM UTC
  2. PowerBuilder
  3. # Permalink

Hi Avory,

The following options in PowerBuilder IDE or the Windows operating system may prevent the selected theme working correctly:

  • The "Windows classic style" option in the PowerBuilder Project painter

When you build the application in the Project painter, you should not check the "Windows classic style" option. If "Windows classic style" is selected, the application UI will be rendered in the Windows classic style instead of the selected theme.

  • The "Windows Classic" theme in the Windows operating system

When the application is running in the Windows system and if the Windows system theme is set to "Windows Classic", then the application UI will be rendered in the Windows Classic theme instead of the selected theme.

  • The "Use Windows XP style DPI scaling" option in Windows 7, Windows Server 2012, or earlier

         If the scaling percentage is set to 125% or lower, the "Use Windows XP style DPI scaling" option will be automatically selected, which will prevent the selected theme working correctly. In such case (125% or lower), you should manually uncheck the "Use Windows XP style DPI scaling" option.

Please also check whether the pbjson190.dll and pbtheme190.dll files are in your PB Runtime DLLs. They are required.

If the issue still persists after checking the above options, I suggest you submit a bug in our support ticketing system https://www.appeon.com/standardsupport/ with a small reproducible case including pbl, exe. pbd and PB Runtime DLLs. Thanks in advance.

  

Regards,

Ken

Comment
  1. Avory Rose Pastoral
  2. Wednesday, 4 September 2019 05:45 AM UTC
Hi Ken,



Thank you so much for your suggestion! I have managed to resolve my problem based on your solution of adding pbjson.dll and pbtheme190.dll. Thank you so much!!!
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Saturday, 28 September 2019 07:22 AM UTC
  2. PowerBuilder
  3. # 1

Just to be complete:

I had a small error in test2.zip.

Here's the corrected version (Thank you Chris !!)

 

Attachments (1)
Comment
  1. Chris Pollach @Appeon
  2. Saturday, 28 September 2019 15:24 PM UTC
My pleasure Miguel ... Anytime! ;-)
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Wednesday, 4 September 2019 05:31 AM UTC
  2. PowerBuilder
  3. # 2

Now I've made a second test example.

(Test2.zip)

 

I wanted to check what happens when in the "Switch Theme" button, I DON't use a relative path to the Theme folder.

1) The theme folder is now called "theme190" instead of "mythemes"

2) I do an applyTheme() without specifying any path at all

3) It still works!! even after changing the internal current directory.

I thought it would be because there might be something cached, but I checked on a clean VM and it still works.

(had to add the atl100.dll by the way)

 

So my conclusion is that you might be doing something similar as to what I did in the first sample app, with a relative path OR you were missing some DLL's OR you are changing in such a way that the Runtime Dll's are no longer found OR ... might there be something wrong with your custom JSON file?

Kind of a mystery, but at least you have a solution with Ken's reply and my samples I hope.

regards,

Comment
  1. Avory Rose Pastoral
  2. Wednesday, 4 September 2019 05:48 AM UTC
Hi Miguel,



Thank you so much for all your help you've been so kind and gave me all the solution that might help me! Forgot to notice I am missing DLLs (Pbtheme and Pbjson) as it is not included in Appeon's documentation about adding a theme. Thank you so much, once again for all the help. May you have a best day ahead! =)
  1. Helpful
  1. Miguel Leeuwe
  2. Wednesday, 4 September 2019 08:25 AM UTC
Your welcom Avory,

same to you.
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Wednesday, 4 September 2019 05:04 AM UTC
  2. PowerBuilder
  3. # 3

I have done a small application to illustrate what I meant with "changing the internal directory of windows".

See the attached Zip.

1) Rename the shared folder of your Appeon powerbuilder installation(s) to something else temporarily for this test.

2) unzip the attachment somewhere

3) run the genapp.exe (so not from the powerbuilder IDE)

4) click on "Switch Theme" repeatedly, it'll cycle through the four standard themes.

5) click on "Do something that changes windows' internal directory"

6) click on "switch theme" again. It has stopped working because the operation on any other directory like reading or writing files, Dirlist() etc. has changed the current directory and the relative path to the folder with themes no longer works.

7) click on "set the current directory back to what it was ....

8) click on "swith theme" it should work again.

(by the way, I've assumed you have a C: drive, for the DirList() command to work)

 

Hope it helps

regards

Attachments (1)
Comment
  1. Sanjay Shivade
  2. Friday, 27 September 2019 16:14 PM UTC
1 thru 4 works as stated above.

5 and 6 have no effect. 1 thru 4 still works after changing the directory by 5 and 6.

7 and 8 are not needed as 5 and 6 aren't changing the directory.



So what's the conclusion? What do you have in this app that I don't have in app's open event?



Thanks!
  1. Helpful
  1. Sanjay Shivade
  2. Friday, 27 September 2019 16:20 PM UTC
An observation your genapp.exe while executing throws "Security Warning"



The publisher could not be verified. Are you sure you want to run this software/

Name : C:\test2\genapp.exe

Publisher : Unknown Publisher

Type : Application

From : C:\test2\genapp.exe



This file does not have a valid digital signature that verifies the publisher. You should only run software from publishers you trust.



My own apps which aren't working do not throw this warning. Is there any connection between these two?



Thanks!
  1. Helpful
  1. Miguel Leeuwe
  2. Friday, 27 September 2019 21:06 PM UTC
HI Sanjay, you are right. If I run the application (the one before uploading it as test2.zip), no problem. But ...

There's something funny going on with Appeon executables. I just downloaded my own sample in the zip file and Avast antivirus spent 10 minutes analyzing it. Then it told me it's okay. That's on my work computer. At home I cannot event generate the simplest application and run the executable. Kaspersky antivirus somehow modified the executable. No warnings, no errors, simply doesn't do anything when you run the exe. (my solution has been to no longer use kaspersky).

My computer is clean. I've run full scans with Avast, Malwarebytes, Adwcleaner and window bit defender. No viruses.

There's something in the executables that antivirus heuristics don't seem to like.

I'm starting to wonder if we should generate the executables with an embedded manifest as invoker. I'll post this question on this forum.
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Tuesday, 3 September 2019 09:34 AM UTC
  2. PowerBuilder
  3. # 4

Hi,

(this is just a guess of what might be happening).

 

So you are NOT doing an install of the pb runtimes?

If not, then you'd have to make sure that you don't change the "internal active directory" of windows with you code.

What I mean to say is that if for example you read an INI file somewhere in a different folder or wrte a log file or have a dialog popping up in which you select files from a different folder, then your internal windows directory no longer points to where the executable of you application is and thus won't find the runtime files anymore.

If doing operations with files in other folders, always use ChangeDirectory(...) to go back to the directory of the application afterwards.

 

HTH

Comment
  1. Avory Rose Pastoral
  2. Wednesday, 4 September 2019 01:08 AM UTC
Yes I am installing powerbuilder runtime libraries.
  1. Helpful
  1. Avory Rose Pastoral
  2. Wednesday, 4 September 2019 01:10 AM UTC
May I know the complete libraries I need to include in my installer. Thank you.
  1. Helpful
  1. Miguel Leeuwe
  2. Wednesday, 4 September 2019 05:05 AM UTC
Ken already replied to that, but while he did I was doing a small application to illustrate what I meant with "changing the internal directory of windows". See my second answer
  1. Helpful
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.