locked
Sequencing legacy application with compatibility mode or shims RRS feed

  • Question

  • I’m trying to sequence a nine year old application (VanDale).
    If installed physical and with Compatibility Mode set to “Windows 98 / Me” the application run flawless under Windows 7 x64.

    So I sequenced the application:

    Sequence #01: Set Compatibility Mode while monitoring.

    During sequencing I changed the Compatibility Mode to Windows 98 / Me. But it seams that this isn’t captured during the monitor phase, because after streaming the sequence to the client the application behaved like the Compatibility Mode wasn’t set.

    Sequence #02: Created a shim (.sdb) with ACT

    I created a .sdb file with ACT 5.6. This shim applied the WIN98 Compatibility Mode to my legacy application executable (.exe). If I run this .sdb file with sdbinst.exe on a client computer with the legacy application physical installed all works well. But when I try to apply the shim to my sequence it fails.
    In the Dependency -tag I tried to install the shim in several ways:

    Using the VFS location:
    sdbinst /q C:\VanDale\NF-FN\V2.0.1\Application\VanDaleNF.sdb \n
    Using the Softgrid mounted drive:
    sdbinst /q %SFT_MNT%\vDaleNF.v2\VFS\VanDale\NF-FN\V2.0.1\Application\VanDaleNF.sdb \n
    Using the Q drive:
    sdbinst /q %SFT_MNT%\vDaleNF.v2\VFS\VanDale\NF-FN\V2.0.1\Application\VanDaleNF.sdb \n
    Using an UNC path:
    sdbinst /q "\\networkpath\share\vDaleNF.v2\VanDaleNF.sdb" \n

    My OSD:
    <SCRIPT PROTECT="TRUE" EVENT="LAUNCH" TIMING="PRE" WAIT="TRUE" EXTERN="TRUE">
    <SCRIPTBODY LANGUAGE="Batch">

    rem cmd.exe

    rem insert above lines :-)

      </SCRIPTBODY>
    </SCRIPT>

    But none of the did the trick.

    Sequence #03: Adding the AppCompatFlags registry keys in the OSD file:

    In the VIRTUALENV-tag I added these lines:
    <REGKEY HIVE="HKCU" KEY="Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" NOREDIR="FALSE">
    <REGVALUE REGTYPE="REG_SZ" NAME="C:\VanDale\NF-FN\V2.0.1\Application\VDFN.exe">WIN98</REGVALUE>
    <REGVALUE REGTYPE="REG_SZ" NAME="%SFT_MNT%\vDaleNF.v2\VFS\VanDale\NF-FN\V2.0.1\Application\VDFN.exe">WIN98</REGVALUE>
    </REGKEY>

    I added both C:\ and Q:\ locations, both none of them worked.

    Now I’m out of idea’s.
    Did I looked over something or can’t this be done with App-V?


    Friday, July 15, 2011 8:31 AM

Answers

  • Crazylarry, thanks for your reply. Your osd script works fine but the user needs to start the shortcut as an admin. Because using sdbinst.exe needs administrative privileges. Do your users launch your app with right-click > Run as administrator?

    It's like Znack's approach, installing the shim outside the bubble. With Znack's approach an admin installs the shim (using SCCM for example).

    For my application your approach has the same effect as Znack's; the shim is applied correctly, and the error message doesn't appear. However the feature isn't fixed either :'(

    Like Znack said: "since no error message is presented I am assuming that the shim is applied and read - however there is a failure of some sort of opening the help-file"

    I opened the help feature during sequencing multiple times, but that didn't solved it either.


    • Proposed as answer by znack Tuesday, August 2, 2011 12:41 PM
    • Marked as answer by Ben De Vriese Tuesday, August 2, 2011 12:44 PM
    Friday, July 29, 2011 9:34 AM

All replies

  • Have you read this article: Making Applications Compatible with Windows 7 in a Virtualized Environment

    This forum post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.
    Friday, July 15, 2011 8:42 AM
    Moderator
  • Installing the shims via the package itself will not work is the users does not have Administrative rights and UAC is enabled. Add the shims to the machine as an administrator before running the package.

    This forum post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.
    Friday, July 15, 2011 8:45 AM
    Moderator
  • I did read Chris Jackson's article, but I will read it again in case I missed something :-)

    Thx,

    Ben

    Friday, July 15, 2011 8:45 AM
  • He mentions that sdbinst.exe will auto-elevate, but I'm not convinced (until I get a chance to test). Just as a test, run sdbinst as a manual step before running the package.

    This forum post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.
    Friday, July 15, 2011 8:57 AM
    Moderator
  • Indeed, sbinst.exe always asks for elevation. So normal users cannot use sbinst.exe because they doesn't have admin privileges.

    Aaron, what do you mean exacly by "running sdbinst as a manual step before running the package."?

    thx,

    Ben

    Friday, July 15, 2011 9:08 AM
  • Logon as an admin, and run the sdbinst command manually from the command line - you may need the .sdb file availabe outside of the package

    Once sdbinst has successfully run, run the vApp as a standard user



    This forum post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.
    Friday, July 15, 2011 9:15 AM
    Moderator
  • Installing the shim as an admin is no problem, but the application still fails. It seems to me that the shims doesn't work in the virtual environment.

    I have applied the shim to c:\VanDale\NF-FN\V2.0.1\Application\VDFN.exe, this shim works on the physical installed app. Maybe I need to apply the shim to application executable in the VFS location (Q:\vDaleNF.v2\VFS\VanDale\NF-FN\V2.0.1\Application\VDFN.exe)?

    Tuesday, July 19, 2011 11:36 AM
  • Hello,

     

    The shim should be applied outside of the virtual environment - and perhaps you can exclude the location as a attribute to specify it on?


    /Znack
    Tuesday, July 19, 2011 1:22 PM
  • Apply the shim to the path: Q:\vDaleNF.v2\VFS\VanDale\NF-FN\V2.0.1\Application\VDFN.exe

    This forum post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.
    Tuesday, July 19, 2011 2:15 PM
    Moderator
  • Thanks, but applying the shim to Q:\vDaleNF.v2\VFS\VanDale\NF-FN\V2.0.1\Application\VDFN.exe doesn't work either.

    I applied the shim this way (explained with screenshots). If this is the way to apply shims to AppV applications then I doubt if it is possible to work with shims. Have you guys applied a compatibility fix on an AppV application with success?

    Wednesday, July 20, 2011 7:22 AM
  • Hello,

    Yes, several times.

    THe screenshots doesn't really answer anything..

    Are you applying it inside or outside of the sequence?

    How are you determing which .EXE it should apply to?


    /Znack
    Wednesday, July 20, 2011 7:25 AM
  • I applied the shim both inside and outside the sequence.

    But i'm testing all the time with a sequence that contains the applied shim, maybe here lies the issue. I will try again with the original sequence, without any shim in the sequence. Only apply the shim outside the sequence, cross fingers :-)

    One of the ways to determine the .exe location is SFT Explorer Application Virtualization explorer; screenshot.

    Wednesday, July 20, 2011 7:47 AM
  • Hello,

    What metrics within the shim are you using to determine what .exe it should apply to?
    /Znack
    Wednesday, July 20, 2011 8:01 AM
  • To create the first shim I installed the legacy application on C:\VanDale\NF-FN\V2.0.1\Application\VDFN.exe, and created the shim from there.

    For the second shim I installed the app on Q:\vDaleNF.v2\VFS\VanDale\NF-FN\V2.0.1\Application\VDFN.exe, because the .exe needs to be in place to create the shim.

    I recreated the shim, because I cannot find how to show the full path of the .exe in Compatibility Administrator (ACT):

    01 Create new application fix

    02 application (.Exe) location

    03 Win98 compatibility mode

    I used the defaults, just picked the Windows 98 / Windows Me -Compatibility mode from the combo box, no additional compatibility modes.


    Wednesday, July 20, 2011 8:33 AM
  • There may be a way to make this work if you try this as the path:

     

    \\127.0.0.1\Q$\vDaleNF.v2\VFS\VanDale\NF-FN\V2.0.1\Application\VDFN.exe


    Then apply the shim locally using the ACT. test this to see if it works then we can go from there as to how to deploy this to standard users.


    Steve Thomas, SSEE, Microsoft
    App-V/MED-V/SCVMM/SCCM/AppCompat
    http://madvirtualizer.wordpress.com/
    The App-V Team blog: http://blogs.technet.com/appv/
    The MED-V Team Blog: http://blogs.technet.com/medv
    The SCVMM Team blog: http://blogs.technet.com/scvmm/

    “This posting is provided "AS IS" with no warranties, and confers no rights. User assumes all risks.”
    Wednesday, July 20, 2011 9:30 PM
  • Thanks for your reply Steve, unfortunately this approach didn't work either.

    I made a new shim (screenshot), with program location \\127.0.0.1\Q$\vDaleNF.v2\VFS\VanDale\NF-FN\V2.0.1\Application\VDFN.exe. Installed the shim with ACT (also with the command line util sdbinst.exe), but unfortunately this approach had no effect on my legacy application.

    However after installing this new shim, the locally installed app works in WIN98 compat mode. Like with my previous made shims, this shim does work on the locally installed app, but doesn't work on the app-v package.

     




    Friday, July 22, 2011 6:34 AM
  • When the shim (pointing to Q:\vDaleNF.v2\VFS ..) is installed, and local interaction is allowed and if the Workingdirectory is set to Q:\ the error message doesn't appear. However the feature isn't fixed either :'(

    <POLICIES>
        <LOCAL_INTERACTION_ALLOWED>TRUE</LOCAL_INTERACTION_ALLOWED>
    </POLICIES>

    <WORKINGDIR>Q:\vDaleNF.v2\VFS\VanDale\NF-FN\V2.0.1\Application</WORKINGDIR>

    I checked with ProcMon, to find out why no message box appeared. What I find out is a difference between local installed app and delivered via AppV. Many ReadFile operations in the local installed app. While the AppV application has only CreateFile/QueryBasicInformationFile/WriteFile/CloseFile operations to the help file Q:\vDaleNF.v2\VFS\VanDale\NF-FN\V2.0.1\Application\help\fhulp.chm

    Local installed app:
    CreateFile, C:\VanDale\NF-FN\V2.0.1\Application\help\fhulp.chm
    QueryStandardInformationFile, C:\VanDale\NF-FN\V2.0.1\Application\help\fhulp.chm
    QueryBasicInformationFile, C:\VanDale\NF-FN\V2.0.1\Application\help\fhulp.chm
    ReadFile, C:\VanDale\NF-FN\V2.0.1\Application\help\fhulp.chm
    ReadFile, C:\VanDale\NF-FN\V2.0.1\Application\help\fhulp.chm
    ReadFile, C:\VanDale\NF-FN\V2.0.1\Application\help\fhulp.chm
    ...

    AppV application:
    CreateFile, Q:\vDaleNF.v2\VFS\VanDale\NF-FN\V2.0.1\Application\help\fhulp.chm
    WriteFile, C:\Users\-username-\AppData\Local\SoftGrid Client\VDALENF.V2-AE2D182A-44F1-4600\UsrVol_sftfs_v1.tmp
    QueryBasicInformationFile, Q:\vDaleNF.v2\VFS\VanDale\NF-FN\V2.0.1\Application\help\fhulp.chm
    CloseFile, Q:\vDaleNF.v2\VFS\VanDale\NF-FN\V2.0.1\Application\help\fhulp.chm
    WriteFile, C:\Users\-username-\AppData\Local\SoftGrid Client\VDALENF.V2-AE2D182A-44F1-4600\UsrVol_sftfs_v1.tmp
    WriteFile, C:\Users\-username-\AppData\Local\SoftGrid Client\VDALENF.V2-AE2D182A-44F1-4600\UsrVol_sftfs_v1.tmp
    CreateFile, Q:\vDaleNF.v2\VFS\VanDale\NF-FN\V2.0.1\Application\help\fhulp.chm
    WriteFile, C:\Users\-username-\AppData\Local\SoftGrid Client\VDALENF.V2-AE2D182A-44F1-4600\UsrVol_sftfs_v1.tmp
    QueryBasicInformationFile, Q:\vDaleNF.v2\VFS\VanDale\NF-FN\V2.0.1\Application\help\fhulp.chm
    CloseFile, Q:\vDaleNF.v2\VFS\VanDale\NF-FN\V2.0.1\Application\help\fhulp.chm
    ..no readfile operation

    Maybe I need to resequence with Enforce Security Descriptors off?


    Friday, July 22, 2011 11:43 AM
  • Enforce Security Descriptors didn't do the trick.
    Friday, July 22, 2011 1:07 PM
  • Hello,

    What if you install the application to q:\assetdir and apply the shim? Any specific reason it must be installed to the root C:-drive?

    (since no error message is presented I am assuming that the shim is applied and read - however there is a failure of some sort of opening the help-file)

    (and I never use location when applying shims but often try to limit my usage to .exe-filename and version or size of the file)


    /Znack
    Friday, July 22, 2011 2:13 PM
  • The app won't start if it's not installed on C:\.

    Installing in Q:\vDale.xxx isn't an option.

    Thanks for the tip, to apply a shim to an exe without location (full path).

    Tuesday, July 26, 2011 11:22 AM
  • To get this to work, I had to copy the .sdb file to the machine from the server and run sdbinst.exe externally to the virtualised environment. I could not get Chris Jackson's solution to work at all. Here is my OSD file:

     

    <SCRIPT EVENT="LAUNCH" PROTECT="FALSE" TIMING="PRE" WAIT="TRUE">

    <SCRIPTBODY>

    cmd.exe /c copy \\\\%SFT_SOFTGRIDSERVER%\\content\\EasyJob\\EJ.sdb C:\\Windows\\System32\n

    sdbinst.exe /q C:\\Windows\\System32\\EJ.sdb\n

    </SCRIPTBODY>

    </SCRIPT>

    <SCRIPT EVENT="SHUTDOWN" PROTECT="FALSE" TIMING="POST" WAIT="TRUE">

    <SCRIPTBODY>

    C:\\windows\\System32\\sdbinst /u C:\\windows\\System32\\EJ.sdb\n

    cmd.exe /c del C:\\Windows\\System32\\ej.sdb\n

    </SCRIPTBODY>

    </SCRIPT>

    Thursday, July 28, 2011 10:43 AM
  • Crazylarry, thanks for your reply. Your osd script works fine but the user needs to start the shortcut as an admin. Because using sdbinst.exe needs administrative privileges. Do your users launch your app with right-click > Run as administrator?

    It's like Znack's approach, installing the shim outside the bubble. With Znack's approach an admin installs the shim (using SCCM for example).

    For my application your approach has the same effect as Znack's; the shim is applied correctly, and the error message doesn't appear. However the feature isn't fixed either :'(

    Like Znack said: "since no error message is presented I am assuming that the shim is applied and read - however there is a failure of some sort of opening the help-file"

    I opened the help feature during sequencing multiple times, but that didn't solved it either.


    • Proposed as answer by znack Tuesday, August 2, 2011 12:41 PM
    • Marked as answer by Ben De Vriese Tuesday, August 2, 2011 12:44 PM
    Friday, July 29, 2011 9:34 AM
  • OK, I just applied a compatibility mode fix simply by doing the following:

    Took an application I knew did not work on Windows 7 and sequenced it on Windows XP. Tested it and it ran just fine post sequence.

    Added the WIn7 OS tag to the OSD.

    Launched the application from a Windows 7 Machine with the App-V client running and verified it had the same issues as the locally installed application. It did.

    Installed Compatadmin on that same client workstation.

    I then launched the virtualized application and left it running.

    Created the compatibility fix for the application by pointing it to the executable using the convention \\127.0.0.1\q$\<SFTMNT>\Directory\Application.exe

    (i.e. \\127.0.0.1\Q$\stocktr.001\stocktrader\stocktrader.exe)

    Applied Fix, Saved it (the SDB.) Installed the shim.

    Launched application, and the shim applied just fine.

    The Shim will have to deployed independently of the virtual application but it should be a one time deployment.


    Steve Thomas, SSEE, Microsoft
    App-V/MED-V/SCVMM/SCCM/AppCompat
    http://madvirtualizer.wordpress.com/
    The App-V Team blog: http://blogs.technet.com/appv/
    The MED-V Team Blog: http://blogs.technet.com/medv
    The SCVMM Team blog: http://blogs.technet.com/scvmm/

    “This posting is provided "AS IS" with no warranties, and confers no rights. User assumes all risks.”
    Saturday, July 30, 2011 2:13 AM
  • Ben - I was running as admin all the time and the shim was being installed correctly. I also ran 'cmd.exe /K sdbinst.exe /q C:\\Windows\\System32\\EJ.sdb' so that the command window did not exit immediately. From there I could see that the SDB installed OK, but it did not affect the application. This SDB worked in a non-virtual environment fine.

     

    Steve - I agree. Deploying the shim outside of the bubble is the only solution to this I can see that works.

    Monday, August 1, 2011 9:08 AM