Video Screencast Help

Program Compatibility Assistant problems in Windows 7

Created: 18 Nov 2009 • Updated: 22 May 2010 | 16 comments
This issue has been solved. See solution.

I have some problems with PCA (Program Compatibility Assistant) in Windows 7 popping up for my installation. My installation is made with Wise Installation Studio 7 SP1 and consists of an msi compiled to an exe with prerequisites where the prerequisites script has been edited. The PCA is not triggered if the name of the setup application is 'setup.exe', but any other name triggers the PCA.

There is a knowledgebase article that mentions this problem in Vista when installing from a network place, but it says it is fixed in version 7 SP1. https://kb.altiris.com/article.asp?article=34576&p=1

I have read that the PCA has changed a lot in Windows 7, so that is probably why nobody else have reported this yet (Windows 7 is quite new). I found some info on the issues here:
http://blogs.msdn.com/astebner/archive/2007/05/17/...
http://blogs.msdn.com/astebner/archive/2007/10/15/...

According to Microsoft, I added supportedOS to the application manifest (in the stub folder of Wise Package editor), but this did not help. The PCA is still popping up.

This is how the manifest looks like now (verified by extracting it from the installation package by mt.exe):

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
        <security>
            <requestedPrivileges>
                <requestedExecutionLevel level="requireAdministrator" />
            </requestedPrivileges>
        </security>
    </trustInfo>
    <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
        <application>
            <!--Windows 7-->
            <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
            <!--Windows Vista-->
            <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />
        </application>
    </compatibility>
</assembly>

I am sure the manifest works, because I made a test with two dummy setups, one with my modified manifest and one with the original Wise manifest. The setup with my modified manifest did not trigger PCA, whereas the setup with the original manifest did trigger the PCA. This also indicates that there is something else in my setup that triggers the PCA and I am quite sure it is the runtime stub, as described in the knowledgebase article linked above.

I also tried to add an entry to Add or Remove Programs to prevent the PCA from popping up, but it didn't help.

I can only hope that this will be fixed/implemented in the next Service Pack, but somehow I am afraid that it will not be. I should probably report it to Wise. But this is difficult, because you cannot report bugs anymore without a valid Support agreement.

Has anyone else seen this problem?

 

Discussion Filed Under:

Comments 16 CommentsJump to latest comment

EdT's picture

WIS 7 SP1 does not natively support Windows 7, and as you have already noted. Unfortunately there is no sign of a service pack for WIS7.
You could always post your bug in the "Ideas" forum as it would be a good idea to get it fixed.

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

heik0's picture

Hi Johan

Some ideas - not sure if they required, or will help:
* Has your exe/application file also got a manifest ?
* Have you signed your application ?
* Have you signed your installer file ?

Thanx btw for your post. Had the same problem - added OS info to the manifest (setup file) and all seems to work. Still gotta test the full install though.

Regards,
  Heiko
 

JohanH's picture

The pre-requisites do not necessarily have manifests, I have not checked (.NET, MSI, SQL Express etc.). I am installing a lot of pre-requisites + the MSI. But even when reinstalling the setup when all prereqisites are already installed, it also triggeers the PCA, which lead me to believe that it is not the prerequisites that triggers the PCA.

My setup EXE and MSI is unsigned. I'm not sure if this would help. We are going to sign our apps in the future.

When i reduced the setup wse script to a very simple setup that contained almost nothing, it worked very well. I made two different simple setups, one with a default manifest and one setup with a manifest with the added supportedOS attribute. This test worked well in that the setup without the supportedOS attribute triggered the PCA, whereas the other setup with the included attribute did not trigger the PCA.

The stub file that Wise creates when compiling the prerequisites into the EXE file together with the MSI files also contains a manifest. I extracted it with mt.exe and it looks like this:

Manifest from stub file:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<ms_asmv2:trustInfo xmlns:ms_asmv2="urn:schemas-microsoft-com:asm.v2">
   <ms_asmv2:security>
      <ms_asmv2:requestedPrivileges>
         <ms_asmv2:requestedExecutionLevel level="requireAdministrator"></ms_asmv2:requestedExecutionLevel>
      </ms_asmv2:requestedPrivileges>
   </ms_asmv2:security>
</ms_asmv2:trustInfo>
</assembly>

It does NOT contain the supportedOS attribute like in the final EXE file. So this means that Wise doesn't use the template manifest for creating the stub manifest. It is probably hard coded.

I was able to test by adding the Compatibility section to the stub file manifest with mt.exe and recompiling only the wse (this doesn't recreate the stub). However, it still triggers the PCA when also the stub has the supportedOS attribute.

This is so time consuming to test, I have to do other things also. I might test further to narrow it down when I got more time.

pbishop's picture

Hi all.  I am new to this install thing as they recently let go of our install guy and gave those responsibilities to me.   I have a few questions.  Wise 7 doesn't support Windows 7?  If not is there a new version out that does?  Also I am a little confused about this code  you've mentioned that you can put in that can solve this problem.  Where does it go exactly?  I have a wise install that starts with a custom wrapper.  So I get the program compatability error twice when testing on windows 7.  Any help would greatly be appreciated.

Thanks

Phil

EdT's picture

It is unreasonable of your employer to dump these responsibilities on you without offering at least a training course to get you up and running in minimal time.
Wise Installation Studio has been around for a couple of years and predates Windows 7, so there is currently no official support for Win 7, although there may be an update released in the next few months which may add this support officially.
However, windows 7 is not hugely different to Vista, so creating installers should still be possible.
The code discussion above refers to the contents of the manifest.
If you are unfamiliar with what a manifest is and what it does, may I recommend spending a few minutes with Mr Google to bring yourself up to speed.

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

JohanH's picture

You can find the manifest template in the stub folder of Wise Package editor. Or you can simply extract, edit and add the manifest with mt.exe (from the Visual Studio command prompt).

pbishop's picture

Okay so I found the manifest template.  I guess I am not really for sure what to do with it.  I did a bunch of reading online and cant seem to make it work.  I found an app called Resource tuner that will take your current exe and do SOMETHING to it and then magically it works.  I wan't to know what its doing so I can do it myself.  I guess I am more confused then ever now.  I also don't how to add the manifest to my install using mt.exe.  Back to reading I guess.

GerhardH's picture

The same problem exists with SP2 of Wise Installation Sudio 7.0. My setup also has a prerequisite and I have modified the .wse file.

Under Windows 7 the PAC pops up two times. The first popup is triggered by WisePrereq.exe and the second by the Wise internal Exe that is copied to a temporary location and executed from there.

I got rid of the PAC popup of WisePrereq.exe when I replaced the original embedded manifest by a modified manifest which had the supportedOS statements as described by Johan. I have no idea how I can solve the second PAC popup, because it seems to be triggered by an internal maybe temorary created Wise executable which I cannot access from outside to replace the default manifest by one which makes more sense on Windows 7.

Edit:
I could solve the problem with the second PAC popup under Windows 7 by replacing the embedded manifest in Wise program stub32.exe. 

SOLUTION
JohanH's picture

Good to here that you solved it. I have to try this, too.

GerhardH's picture

There must have been changes to SP2 to avoid the PCA popups. Our installation has two installation modes: normal installation and installation when a demo version is already installed. With SP1 I always got the PCA popups under Windows 7 for both of our two installation modes. With SP2 normal installation works without any PCA popups. So there is definately an inmprovement with SP2. Our second installation mode for the demo version is a bit tricky. So maybe users of SP2 doing an ordinary installation will never see the PCA popups under Windows 7 and will be happy.

Anyway it is a bit disappointing that the supportedOS entries in the manifest file were not used to turn off the PCA popups in Windows 7 and I had to modify Wise internal Exe files to avoid the PCA popups in any case.     

EdT's picture

GerhardH,
Do you have the time to share with us exactly what changes you have made to avoid the PCA popups?  Publish it as an article and gain some points from Connect!

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

JohanH's picture

I can confirm that it works with 7.0 SP2 after adding the compatibility section to the manifest of the following files.

The first file is an XML file that can be edited with notepad.

...\Wise\WiseScript Package Editor\Stub\stub.manifest

The two second files have to be edited with the Visual Studio tool mt.exe. Use the Visual Studio command prompt. Extract the manifest, add the compatibility section and add the new manifest. Example to add the new manifest: C:\Program Files\Symantec\Wise\Windows Installer Editor\Stub>mt.exe -manifest new.manifest -outputresource:Stub32.exe;#1

...\Wise\Windows Installer Editor\Stub\WisePrereq.exe
...\Wise\Windows Installer Editor\Stub\Stub32.exe

At least it is solved for my part now.

GerhardH's picture

As Johan said the file that must be changed are
..\Wise\Windows Installer Editor\Stub\Stub32.exe
..\Wise\Windows Installer Editor\Stub\WisePrereq.exe

My approach was a bit different from those of Johan. 
stub32.exe:
I wanted to modify the original manifest of stub32.exe and therefore I extracted the manifest with mt.exe application. As Johan said mt.exe is shipped with some Visual Studio versions or can be found in the Microsoft Windows SDK (formerly known as Microsoft Platform SDK).
1. extract manifest from stub32.exe:
"C:\Programme\Microsoft Platform SDK\Bin\mt.exe" -inputresource:stub32.exe;#1 -out:stub32.manifest
2. add the compatibily info to the stub32.manifest file by using an editor that supports UTF-8 encoding. Afterwards it will look like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<ms_asmv2:trustInfo xmlns:ms_asmv2="urn:schemas-microsoft-com:asm.v2">
   <ms_asmv2:security>
      <ms_asmv2:requestedPrivileges>
         <ms_asmv2:requestedExecutionLevel level="requireAdministrator"></ms_asmv2:requestedExecutionLevel>
      </ms_asmv2:requestedPrivileges>
   </ms_asmv2:security>
</ms_asmv2:trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
   <application>
      <!--Windows 7-->
         <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
      <!--Windows Vista-->
         <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />
   </application>
</compatibility>
</assembly>
3. replace the existing manifest in stub32.exe with the modified stub32.manifest file:
"C:\Programme\Microsoft Platform SDK\Bin\mt.exe" -manifest stub32.manifest -outputresource:stub32.exe;#1

WisePrereq.exe:
1. extract manifest from WisePrereq.exe:
"C:\Programme\Microsoft Platform SDK\Bin\mt.exe" -inputresource:WisePrereq.exe;#1 -out:wiseprereq.manifest
2. add the compatibily info to the wiseprereq.manifest file as described above for the stub32.manifest
3. WisePrereq.exe has a digital signature. The existing signature will be lost or corrupted if the modified manifest file is added to WisePrereq.exe. Because I wanted to sign the modified WisePrereq with our companys code signing signature I had to remove the existing signature first from WisePrereq.exe. Therefore I wrote a simpe tool (quick and dirty) to enumerate the signatures in WisePrereq.exe and removed the existing signature. If the signature is not removed first it will not be possible to sign WisePrereq.exe after the modified manifest file was added, because signature is broken. I think it is a good idea to remove the signature first even if you do not intend to add your own signature afterwards.
a) Enumerate signatures to get signature index: remcert.exe <c:\pathtowiseprereq.exe>\WisePrereq.exe -enum
The signature enumeration returns index 0 for the signature in WisePrereq.exe
b) Remove signature from WisePrereq.exe: remcert.exe <c:\pathtowiseprereq.exe>\WisePrereq.exe -del=0
Now the Symantec signature is removed from WisePrereq.exe
4) add the modified manifest to WisePrereq.exe as described above for stub32.exe in step 3
5) If you have an own code signing signature you can now sign the modified WisePrereq.exe

Afterwards replace the original files stub32.exe and WisePrereq.exe with the modified files.

Thanks Johan for pointing me to the compatibility info in the manifest file.

Here (http://msdn.microsoft.com/en-us/library/dd371711(VS.85).aspx) are some additional infos about the effects of adding the compatibility info to the manifest. It says that "Applications with Compatibility section will not get the PCA mitigation" unter Windows 7 and that's what we all wanted. Setting the compatibilty info also has some side effects to the Windows 7 behavior for that application, but until now I did not have any problems with the modified files.

AttachmentSize
remcert.zip 19.58 KB
JohanH's picture

I did extract the original manifests of Stub32.exe and WisePrereq.exe before editing and adding it again. I was not aware that WisePrereq.exe was signed, though. Thanks for pointing it out and making the tool available.

pbishop's picture

I'd like to thank all of you guys and especially Gerhard for his detailed instructions.  This solved my problem perfectly.  What I don't get is why they didn't fix this in SP2.  Also what I don't get is I called them and used a tech support incident and they were of no help at all and said it was a Windows 7 problem and they offered NO helpl.  Now after reading this and implementing what Gerhard said it seems to me that it is their problem.  Maybe I am wrong.  Thanks again.