1 2 Previous Next 16 Replies Latest reply on Jul 25, 2013 8:44 AM by Squidly Man

    Compatibility Mode

    JesseR99 Lurker

      After searching through the forums, I wasn’t able to find a clear answer to my question.


      I am trying to thinapp an old windows 98 title, which runs on windows XP when Compatibility Mode (windows 98/ windows ME) is used. Then after capturing the image, this setting doesn't thinapp into the EXE.


      I have tried changing the setting on the EXE after building the package. I also changed the compatibility mode on the file in the capture directory before building the package. Neither worked.


      Is there any trick to force Compatibility Mode to capture correctly?



        • 1. Re: Compatibility Mode
          EuwRhU Enthusiast

          Some time ago I had a similar issue, here is what I did:


          On Windows XP, the Compatibility Mode settings are stored in

          HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers


          If you want your ThinApped application to run with those settings, you need to write them to the physical Registry. You can use the following script (make sure to remove the compatibility settings that you don't want from the line in red):

          Option Explicit
          Function OnFirstSandboxOwner
               Dim compatSettings, registryKey, procID
               compatSettings = Chr(34) & {color:red}"WIN98 256COLOR 640X480 DISABLETHEMES DISABLECICERO"{color} & Chr(34)
               registryKey = Chr(34) & "HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" & Chr(34)
               procID = ExecuteExternalProcess("reg.exe add " & registryKey _
                    & " /v " & Chr(34) & GetEnvironmentVariable("TS_ORIGIN") & Chr(34) _
                    & " /t REG_SZ" _
                    & " /d " & compatSettings _
                    & " /f")
               WaitForProcess procID, 0
          End Function


          It will take effect until the second time you run your ThinApped program.

          • 2. Re: Compatibility Mode
            Squidly Man Hot Shot
            VMware Employees

            Very nice...and a cool scripted workaround! Thank you for the post!!





            -Dean F.


            • 4. Re: Compatibility Mode
              pippox Lurker



              I have a similar problem.


              An applications installed on W7 Professional 32bit, with WinXP SP3 compatibility flags, works just fine.


              Without the compatibility it crashes right away.


              If I understand EuwRhU post, I need to create a vbs in the Project Folder with his script and build the app, right?



              Other then the "compatSettings" variable, I don't have to change anything else?


              "registryKey" is the same in w7 i checked.




              thx for your help

              • 5. Re: Compatibility Mode
                Cannoli Enthusiast

                Sorry to rehash an old thread but how do you use the above script?  I'm able to create a thinapp of MATLAB v7.1 but I have to start the application installation, after the pre-scan in WIN2000 mode on a Windows 7 VM.  I complete the installation and then perform the post scan and build.  When I try to launch the newly created thinapp of MATLAB 7.1, it fails to start the application with the same error that I would see if I tried to start the locally installed MATLAB 7.1 without using WIN2000 compatibility mode.


                So how to I make the thinapp runtime start the MATLAB 7.1 exe in WIN2000 mode?


                I manually edited the physical registry with the compatibility mode setting and even added the the reg key to the registry file in the thinapp build folder, but no success.  I used the physical location of the installation as the starting directory in the registry.  Perhaps this is the problem?  When a thinapp runs, where does the local system running the thinapp think it's running from?


                The registry value to run an application in compatibility mode is "HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers", as listed in the script, and the key is the path to the .exe file with the value being the compatibility mode to run in, WIN2000 in my case.  I'm thinking the path to the .exe is the problem.  Perhaps not?


                I need this thinapp to run in compatibility mode for everyone, every time.  Not jsut one time.


                Any help is greatly appreciated!

                • 6. Re: Compatibility Mode
                  Squidly Man Hot Shot
                  VMware Employees

                  To use a script within ThinApp, simply create the script in the root of the ThinApp project folder before building. 


                  The aforementioned blog post has been updated with a newer version of the script in case you are NOT using ProcessExternalNameBehavior=Original in the [Build Options] of your PACKAGE.INI.  The old script shown above in this thread will still work so long as you are using the ProcessExternalNameBehavior=Original [Build Options].


                  See the ThinApp Pubs - Creating ThinApp Scripts documents and the ThinApp Blogs Scripts section for more assistance.

                  • 7. Re: Compatibility Mode
                    Cannoli Enthusiast

                    I'll give it a try and report back.


                    A few questions, I assume that adding the file to the build folder will include the .vbs file in the final package.  How does the thinapp package know to run the .vbs at runtime? Where is the registry change made, physical or virtual file system?  Is it a permanent change or is it changed each time a user runs the thinapp?

                    • 8. Re: Compatibility Mode
                      Lakshman Virtuoso
                      VMware EmployeesvExpert

                      Yes, the VB script will be included as part of the ThinApp package.


                      There are two options to use the script:


                      1. Always run the script everytime the ThinApp is launched

                      2. Launch the script depending on the callback functions.


                      Please check this link to know more about the callback functions:

                      • 9. Re: Compatibility Mode
                        Cannoli Enthusiast

                        Does the vbs script have to be called a specific name?  Do I have to change anything in the Package.ini for the script to run?  I'm using the second version of the script with the .vbs file in the root of the build package folder.


                        What am I doing wrong?  It still doesn't work.



                        EDIT:  I added cmd.exe to my package.  When I run cmd.exe then go into the physical registry, I can see the line to run cmd.exe win win2000 mode.  I don't see it when I run the actual application I'm trying to virtualize.  It's MATLAB R14

                        • 10. Re: Compatibility Mode
                          Lakshman Virtuoso
                          VMware EmployeesvExpert

                          No specific name required for the script and in the package.ini.


                          To make sure the ThinApp calls your script, please add message box, say MsgBox ("Test") in the script and check.

                          • 11. Re: Compatibility Mode
                            Cannoli Enthusiast

                            I ran it a few more times and refreshed the view in the physical registry.  It looks like it's adding the path to the network share and the thinapp exe where I copied the thinapp package.

                            • 12. Re: Compatibility Mode
                              Squidly Man Hot Shot
                              VMware Employees

                              Additional information around scripting within ThinApp can be found in the ThinApp Bootcamp series - specifically the Scripting within ThinApp session.

                              • 13. Re: Compatibility Mode
                                Cannoli Enthusiast

                                Thank you for the link. While I'm learning from the ground up how to script for ThinApp, Ill add as much information about the problem I'm having with the hope someone who has already mastered this skill will see something that may assist in troubleshooting my problem.   After adding the .vbs script to my package, I expected the physical registry setting to point to the virtual path of the application. That path is c:\Program Files (x86)\MATLAB71\bin\win32\MATLAB.exe  Instead it points to the .exe that the ThinApp packager made and I moved to a network file share. When I run the cmd.exe that included in the thin app package, it creates a physical registry setting that points to the local machine. Is this the expected behavior?  The error I see when I try to run the thinapped MATLAB is the same error I see when I run that vision of MATLAB natively on Win7 without choosing comparability mode. So thats telling me the thinapped package of MATLAB is not running in compatibility mode even though the .vbs script is in the package. It looks like the .vbs script is choosing the wrong exicuitable at runtime and putting in an incorrect registry value.   Any ideas on how to get this to work?  Sorry for the fat fingers, posting this on an iPad on the road.

                                • 14. Re: Compatibility Mode
                                  Squidly Man Hot Shot
                                  VMware Employees

                                  The issue sounds like what I mention in my previous post.


                                  In the "Launching a ThinApp Packaged App in Windows Compatibility Mode" blog post I have updated the script so it will work in case you are NOT using the ProcessExternalNameBehavior=Original setting in the [Build Options] section of your PACKAGE.INI.


                                  The old script shown above in this thread will still work so long as you are using the ProcessExternalNameBehavior=Original setting in the [Build Options] section of your PACKAGE.INI.


                                  I had this issue as well until I properly set the entry point to launch the correct item and also set the ProcessExternalNameBehavior=Original value.  Then when I updated the script, I no longer needed to set the ProcessExternalNameBehavior=Original in the PACKAGE.INI.


                                  Assuming you are using the old script, try setting the ProcessExternalNameBehavior=Original setting under the [Build Options] section of your PACKAGE.INI and rebuild and test.  Before you run the newly built ThinApp package, make sure you both delete the current MATLAB sandbox if one exists (default is %APPDATA%\Thinstall\<sandboxfolder>) and delete the current native registry setting where it's pointing to the incorrect exe.


                                  Note:  Please ensure you are testing on a NON-Production system in case the wrong things are mistakenly deleted or incorrectly set.

                                  1 2 Previous Next