Amitava's Blog on Windows Vista: Application Certification and Compatibility
Welcome to MSDN Blogs Sign in | Join | Help

Certified for Windows Vista logo: Test Case FAQ - Test Case 18

Test case 18: Verify Windows Installer package contains Manufacturer, ProductCode, ProductLanguage, ProductName, ProductVersion (major and minor), and UpgradeCode property tags and that they are not null (Req:2.7)

 

Question: Is it acceptable to have multiple upgrade code entries? If one of the upgrade codes does not have a fully populated version min or version max, is that a failure?

Answer:  The Upgrade table can have multiple entries, here is an example:

 

UpgradeCode

VersionMin

VersionMax

Language

Attributes

Remarks

ActionProperty

XYZ

1.0.1234.0

 

 

256

 

NEWPRODUCTFOUND

XYZ

1.0.1234.0

1.0.1234.0

[ProductLanguage]

512

 

ANOTHERLANGUAGEFOUND

XYZ

0.0.0.0

1.0.1234.0

 

1024

 

UPGRADEDPRODUCTS

 

During the course of installation the installer runs through each record of the Upgrade table in sequence and compares the upgrade code, product version, and language in each row to products installed on the system.

 

The installer checks the VersionMin and if the VersionMin is NULL, the installer tries to detect all previous versions. If the VersionMax is NULL the installer detects all product versions greater than or equal to the value specified by the VersionMin. Hence in this case both VersionMin and VersionMax must not both be null.

 

If the both VersionMin and VersionMax are specified the installer tries to detect all products within the range and also if the values specified for VersionMin & VersionMax equals an empty string ("") it is evaluated the same as 0.

 

 

Question: We have Update table filled in the MSI, but we don’t have any action if we find newer version of our application on the user’s computer. Will it prevent us from passing this TC?

Answer: As far as Update table is concerned, the TC 18 expects, “The Windows Installer package contained UpgradeCode, ProductVersion (VersionMin and VersionMax) property tags in the Upgrade table with the UpgradeCode, ProductVersion (VersionMin must not be null) tags not being Null in order to pass this test case and the UpgradeCode in the Upgrade table must be identical to the UpgradeCode in the Property table.”

So, as long as you have Update table filled up as expected above, you satisfy the TC 18 requirement. The goal of this requirement is actually to enable servicing and upgrading of applications. Even if the application doesn’t take advantage of this, the goal is to allow future compatibility with the OS and ongoing maintainability of the product that’s being certified.

 

 

Question: There are no “products affected by the upgrade” because there is nothing for us to upgrade.  However, TC 18 states “The Windows Installer package contained UpgradeCode, ProductVersion, (VersionMin and VersionMax) property tags in the Upgrade table”.

The only way I see for us to satisfy this test case would be to fabricate a previous version and pretend to upgrade it.

Does this make sense or are we missing something?

Answer: The goal of this requirement is to enable servicing and upgrading of applications. Even if the application doesn’t take advantage of this, the goal is to allow future compatibility with the OS and ongoing maintainability of the product that’s being certified.

 

Resource:

Preventing an Old Package from Installing Over a Newer Version

Certified for Windows Vista logo: Test Case FAQ - Test Case 9

Test Case 9: Verify application launches and executes properly using Remote Desktop (Req.1.8)

 

As per this requirement:

  1. The application must not crash or lose its state when being accessed through a Remote Desktop connection in order to pass this test case.
  2. If application does not support Remote Desktop, it must pop-up a message indicating this to the User and writes a message to the Windows NT Event Log in order to pass this test case.

Question: We would prefer to simply prevent a user launching the client app through Remote Desktop. Can you point me to any documentation on how we can detect this condition so we can prevent it?

Answer: To detect whether your application is running via remote client you can use the following piece of code to check.

 

if (SystemInformation.TerminalServerSession)    // Connected from Remote client

{

       if(!EventLog.SourceExists("My Events"))  // Check for the Event log

             EventLog.CreateEventSource("My Events", "Application");   // Create if not there

 

       string message = "Connected from remote Terminal client";

       EventLog myLog = new EventLog();

       myLog.Source = "My Events";

       myLog.WriteEntry(message, EventLogEntryType.Information);     // Create a new entry to the event log

 

       MessageBox.Show(message);

}

else

       MessageBox.Show("Connected locally");

 

Please note that the class SystemInformation is available in System.Windows.Forms and the property TerminalServerSession returns true if the app is running via remote client. Hope you are already aware of the code for event log. However, just in case it is required you can use the same

 

You can use the above somewhere in the loading event of the application.

 

Posted by amitava | 2 Comments

Certified for Windows Vista logo: Test Case FAQ - Test Case 20

Test Case 20: Verify application does not try to write to or replace any WRP registry keys or files (Req:2.9)

The application must not attempt to write to WRP Registry Keys or replace any system files during install/execution in order to pass this test case. You need to use AppVerifier with LuaPriv option checked. In the AppVerifier log you need to check for LayerName="LuaPriv" Severity="Error"

Question: The AppVerifier log file generated is too large to trace for error. How can I see the exact errors violating TC 20?

Answer: You can first filter out those with Severity="Error". However, not all these errors violate Windows Resource Protection (WRP). That is, all errors may not affect any protected locations (files/registry keys). The protected locations include Windows/System/Program Files locations and few Registry locations. You need to make sure that your application does not write/update the WRPs. You can confirm this from the file or registry location mentioned in the message in the AppVerifier log.

You can check whether a file or registry key is under WRP in either of the ways as follows.

  1. Through code, use SfcIsKeyProtected or SfcIsFileProtected API. If a key is WRP, then the application installer should not install or modify the key.
  2. Use Regedit to check permissions on the key.
    • Keys that are WRP will show Trusted Installer with Full Control. SYSTEM, Administrators, and Users will have Read permissions only.

Trusted Installer is a service that hosts code for install, update, and un-install of OS components. The service is trusted by the system to check for all the prerequisites such as package authenticity, signing authority and dependencies before making system changes

 

Resources:

About Windows Resource Protection

Windows Resource Protection on Windows Vista

Certified for Windows Vista logo: Test Case FAQ - Test Case 32 – On Service

Test Case 32: Verify that the application’s UI thread only handles exceptions that are known and expected (Req:3.2)

Question: Is service applicable for test case 32?

Answer: Yes, it is. However /ui option will not be applicable here if there is no UI thread there. So the thread hijacker command may look like Threadhijacker.exe /crash:av  /process:<process name>. You can also use /tid to inject AV to the active thread of the service.

 

Question: How do I identify the tid# of an executable?

Answer: You can use Process Explorer for Windows v10.21 to perform this action.  It can be downloaded here, http://www.microsoft.com/technet/sysinternals/utilities/ProcessExplorer.mspx

Start process explorer. Browse to the desired application.  Right click on the exe and select properties.  Select the threads tab.  Select one of the entries under Start Address. The tid number is displayed under Thread ID.

 

Question: How do I inject a crash once I have the thread id?

Answer: Use the following command. 

Threadhijacker.exe /tid:<Thread Id> /crash:av /process:<process name>

 

Question: Threadhijacker is failing to crash my application/service.

ERROR HijackThread; Could not Open Thread; hr=80070005; Error 0x80070005. What can I do?

Answer: You can use /debug option as threadhijacker.exe /debugpriv /tid:<your active thread's id>.

However, the thread cannot be in a WAIT state when you inject the crash. Therefore, you need to have threadhijacker inject the crash when the thread is ACTIVE.

So, you may need to use threadhijacker in a loop so that it can ultimately inject the crash when the thread becomes active. You can write a simple batch file for the purpose.

You can start the script and then perform an action to get the thread out of a wait state. Here’s the sample script. Put it in a .bat file called LoopTH.
Text Box: :TH
"C:\Program Files\Microsoft Corporation\Logo Testing Tools for Windows\ThreadHijacker\x86\threadhijacker.exe" /tid:%2 /crash:av /process:%1
PING 1.1.1.1 -n 1 -w 1000 > NUL
goto TH

Here’s the usage:
Usage: LoopTH <service process name> <Thread ID>
e.g.: LoopTH mobsync.exe 5630

Note: Make sure to run it from an elevated command prompt (Right click CMD and “Run as Administrator). Kill the script after the AV occurs.
The ping command is just a way to delay the loop for 1 second. It pings an invalid address with a wait of 1000 milliseconds. This can be adjusted as needed.

In another way, you can try to find the ACTIVE thread and crash the same instead of the service. To find the active thread, you can put debug output in your service to tell you the OS Thread ID of an ACTIVE thread in your app after it starts up (you can get this value using GetCurrentThreadID()). Then use threadhijacker as threadhijacker.exe /debugpriv /tid:<your active thread's id>, you should see the WER crash.

You’ll find similar discussion in MSDN forum at

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1597915&SiteID=1 and

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1804675&SiteID=1

Posted by amitava | 0 Comments

Designing Applications for Windows Vista

 

Considering the security (UAC) enhancements in Windows Vista, you need to follow a guideline. The following list represents guidance for designing applications for Windows Vista before you should go for the Logo Program.

 

Windows Vista application design workflow

Workflow

Description

Step One: Test Your Application for Application Compatibility.

Test your application for Windows Vista application compatibility. This testing can be easily performed by installing the Standard User Analyzer, which is now available as part of ACT 5.0.

Step Two: Classify Your Application.

Classify your application as a standard user, administrator, or mixed user application. Administrative applications in Windows Vista often have a mixture of both administrative and standard user functionality.

Step Three: Redesign for UAC Compatibility.

Redesign your applications functionality for UAC compatibility. Use the information in this section, once you have classified your application and determined whether it must be redesigned for UAC.

Step Four: Redesign Your UI for UAC Compatibility.

Redesign your application user interface. Closely adhering to these guidelines in your applications development will ensure that your application will have a consistent and predictable user experience in Windows Vista.

Step Five: Redesign Your Installer.

Redesign your application installer. The best practices in this section are for well-behaved application installations in a Windows Vista or UAC environment.

Step Six: Create and Embed an Application Manifest.

Create and embed an application manifest with your administrative applications. The correct way to mark your applications is to embed an application manifest within your program that tells the operating system what the application needs.

Step Seven: Test Your Application.

Test your redesigned or new application for application compatibility using the Standard User Analyzer.

Step Eight: Authenticode Signature.

Sign the application with an Authenticode signature to prevent tampering with the executable.

Step Nine: Windows Vista Logo Program.

Participate in the Windows Vista Logo Program.

 

For detailed information about "Designing Applications for Windows Vista" see the Windows Help file, which can be downloaded here. To find this article in the Help file, expand Fundamentals, expand Secure Applications, expand Developing Secure Applications, and then click User Account Control (UAC).

 

Reference:

Windows Vista Application Development Requirements for User Account Control (UAC)

 

Certified for Windows Vista logo: Test Case FAQ - Test Case 32

Test Case 32: Verify that the application’s UI thread only handles exceptions that are known and expected (Req:3.2)

This test case expects an application handle known exceptions only and leaves generic exception for Windows. You do not need to write any additional code to satisfy this test case in Vista. Actually, one should not write any code to catch generic exceptions. Even if you catch generic exception throw the exception again for the Vista to grab and activate Windows Error Reporting (WER).

Question: What is the exact WER message? Is display of this box (just “Close program”), sufficient to pass TC32?

Answer:

clip_image001 

Figure 1: WER Send message

The above is a standard WER message shown in Vista. However, the exact message window may vary depending on a few situations. For WER when an error report is created it can be in one of two states:

  1. Extra data is needed for analysis on the server
  2. No more data is needed for this bucket on the server

clip_image002

Figure 2: WER message with Close

Depending upon the WER setting in the system and the situation above the WER messages can be as follows.

  1. "Do you want to send more information about the problem? Additional details about what went wrong can help Microsoft create a solution.", with TWO buttons, "Send Information", "Cancel".  (Figure 1) 
  2. "MyTest has stopped working. A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available", with a button "Close program".   (Figure 2) 

The above may vary little bit, depending upon WER setting in Control Panel, however, Dialog 2 always comes with Send Information and the Dialog 1 does not have it.

However, for a valid WER to complete, there must be two error messages one with “Source” listed as Application Error and another Information message with “Source” listed as Windows Error Reporting are logged in the event viewer whenever an error occurs.

 

Question: If the user is least privileged user, there is only "Application Error" in the Windows Event Log.

Answer: All crashes (WER) get cued and can only be viewed as an Administrator.  If you open the Event View Snap-in as an admin, these events should be cued and should be able to be seen. 

The last thing one can do is to log onto the machine as an Administrator, inject the failure and in the Control Panel | System Maintenance | Problems and Solutions |View Problem History.

If you see Report Sent and still do not see the event in the event viewer, log-off/log-on. Event should then have finished the cue process and appear.

 

Question: I have a .NET 1.1 application and I’m getting a CLR message, not the WER message.

Answer: WER doesn’t work in .NET 1.1 applications properly. So for future compatibility, recommendation is to make your application upgrade to .NET 2.0.

 

Further resources on WER

Windows Error Reporting and the Problem Reports and Solutions Feature in Windows Vista

What's New in WER

Certified for Windows Vista logo: Test Case FAQ - Test Case 30

Test Case 30: Verify the application is Restart Manager Aware (Req:3.1)

 

Question: Can you provide some code samples to handle Restart manager messages?

Answer: The Restart Manager queries GUI applications for shutdown by sending a WM_QUERYENDSESSION notification that has the lParam parameter set to ENDSESSION_CLOSEAPP (0x1). Applications should not shut down when they receive a WM_QUERYENDSESSION message because another application may not be ready to shut down. GUI applications should listen for the WM_QUERYENDSESSION message and return a value of TRUE if the application is prepared to shut down and restart. If no application returns a value of FALSE, the Restart Manager sends a WM_ENDSESSION message with the lParam parameter set to ENDSESSION_CLOSEAPP (0x1) and the wparam parameter set to TRUE. Applications should shut down only when they receive the WM_ENDSESSION message. The Restart Manager also sends a WM_CLOSE message for GUI applications that do not shut down on receiving WM_ENDSESSION. If any GUI application responds to a WM_QUERYENDSESSION message by returning a value of FALSE, the shutdown is canceled. However, if the shutdown is forced, the application is terminated regardless.

 

When a GUI application receives a WM_ENDSESSION message, the application should prepare itself to shut down within the specified timeout period. At a minimum, applications should prepare by saving any user data and state information that is needed after a restart. It is recommended that applications periodically save the user data and state. You can go through the MSDN resource Guidelines for Applications for a detailed discussion. The following code in C++ does the same.

 

    private static IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)

    {

        IntPtr retVal = IntPtr.Zero;

        switch (msg)

        {

            case 0x0011: //WM_QUERYENDSESSION:

                if (lParam.ToInt32() == 0x1) // ENDSESSION_CLOSEAPP

                {

                    // App is being shtudown for restart (possibly by Restart Manager).

                    // If you do not return within 5 seconds, the shutdown may be blocked

                }

                else

                {

                    // User is logging off;

                    // Return a value of 0 if you want to veto your app being shutdown,

                    // otherwise return 1

                }

 

                handled = true;

 

                break;

 

            case 0x0016: //WM_ENDSESSION:

                if (lParam.ToInt32() == 0x1) // ENDSESSION_CLOSEAPP

                {

                    // App is being shutdown for restart

                    // You have 30 seconds to return control

                }

 

                handled = true;

                break;

        }

 

        return (retVal);

    }

 

// You’ll need this for the HwndSource class

using System.Windows.Interop;

// Run this code at start-up, possibly during the Load event of your main window

HwndSource source = HwndSource.FromHwnd(new WindowInteropHelper(this).Handle);

source.AddHook(new System.Windows.Interop.HwndSourceHook(WndProc));

There is no direct .NET API I know to implement the same. However, you can do that by using interop and Marshaling. Restart Manager and Generic Method Compilation is a very good resource on implementing the same in managed code.

 

Other Resources:

Restart Manager in Vista for developers

Vista: Restart Manager

 

Posted by amitava | 0 Comments

Certified for Windows Vista logo: Test Case FAQ - Test Case 25

Test Case 25: Verify the application properly handles files in use during install (Req:2.12)

 

Question: How can I add the MsiRMFilesInUse Dialog?

Answer: You may not get it automatically from older setup tools. You need to create a transform file and modify your msi file with the transform using Orca. Following are the tables you need to update with. You’ll also find this in the Windows Installer MSDN blog.

 

Control Table

 

Dialog_

Control

Type

X

Y

Width

Height

Attributes

Property

Text

Control_Next

Help

MsiRMFilesInUse

DlgLine

Line

0

234

294

0

1

 

 

 

 

MsiRMFilesInUse

Banner

Bitmap

0

0

374

44

1

 

NewBinary1

 

 

MsiRMFilesInUse

DlgDesc

Text

21

23

292

25

65539

 

Some files that need to be updated are currently in use.

 

 

MsiRMFilesInUse

DlgTitle

Text

13

6

292

25

65539

 

{&MSSansBold8}Files in Use

 

 

MsiRMFilesInUse

DlgText

Text

21

49

348

17

3

 

The following applications are using files that need to be updated by this setup.

 

 

MsiRMFilesInUse

BannerLine

Line

0

44

374

0

1

 

 

 

 

MsiRMFilesInUse

RadioButtonGroup1

RadioButtonGroup

19

187

343

40

16777219

ShutdownOption

 

List

 

MsiRMFilesInUse

List

ListBox

21

66

331

118

7

FileInUseProcess

 

OK

 

MsiRMFilesInUse

OK

PushButton

228

244

66

17

3

 

OK

Cancel

 

MsiRMFilesInUse

Cancel

PushButton

299

244

66

17

3

 

Cancel

RadioButtonGroup1

 

 ControlEvent Table

Dialog_

Control_

Event

Argument

Condition

Ordering

MsiRMFilesInUse

OK

EndDialog

Return

1

1

MsiRMFilesInUse

OK

RMShutdownAndRestart

0

ShutdownOption="ShutdownOption1"

2

MsiRMFilesInUse

Cancel

EndDialog

Exit

1

1

Dialog Table

Dialog

HCentering

VCentering

Width

Height

Attributes

Title

Control_First

Control_Default

Control_Cancel

MsiRMFilesInUse

50

50

374

266

19

[ProductName]

OK

OK

Cancel

Property Table

Property

Value

ShutdownOption

ShutdownOption1

RadioButton Table

Property

Order

Value

x

Y

Width

Height

Text

Help

ShutdownOption

1

ShutdownOption1

6

9

331

14

Automatically close all applications and attempt to restart them after setup is complete.

 

ShutdownOption

2

ShutdownOption2

6

21

322

17

Do not close applications. (A reboot will be required.)

 

 

You may need to use couple of entries (e.g, Banner text NewBinary1 in Control table) to match other table entry. However, once you’ve updated the msi with everything entered, select Generate Transform from the Transform menu, and save the file (e.g, as AddMsiRMFilesInUse.mst). Now you can apply that transform from the VS 2005 setup project command line using MsiTran.exe (in Windows SDK). You need to add this to your PostBuildEvent: "<Microsoft SDKs>\Windows\v1.0\Bin\msitran" -a "$(ProjectDir)AddMsiRMFilesInUse.mst" "$(BuiltOutputPath)". Now every time it builds the installation, it applies this transform.

 

You can also visit the following resources on information on the same

 

v      Using Windows Installer with Restart Manager: http://msdn2.microsoft.com/en-us/library/aa372466.aspx

 

Posted by amitava | 0 Comments
Filed under: ,

Certified for Windows Vista logo: Test Case FAQ - Test Case 8

Test Case 8: Verify application launches and executes properly using Fast User Switching (Req.1.8)

 

Question: Sound is heard from another user’s session for my application on fast user switching. Can it stop automatically?

Answer: You need to manually stop the sound started playing in a user session once he switches. You can create an event handler to trap SessionSwitchReason.ConsoleDisconnect in.SessionSwitch event.

 

// Event handler to trap Switch User

private void SessionSwitchEvent(object sender, SessionSwitchEventArgs e)

{

 

    if (e.Reason == SessionSwitchReason.ConsoleDisconnect)  //Console Disconnected (switched user)

    {

        audio.Stop();   //Stop the audio object

    }

    else

        if (e.Reason == SessionSwitchReason.ConsoleConnect) //Console Connected

        {

            audio.Play(strMediafilePath);     //Play the audio file again

        }

}

 

Add the event handler method to the SessionSwitch event appropriately.

private void Form1_Load(object sender, EventArgs e)

{

    SystemEvents.SessionSwitch += new SessionSwitchEventHandler(SessionSwitchEvent); //Add the SessionSwitch EventHandler

 

}

Certified for Windows Vista logo: Test Case FAQ - Test Case 19

Test  Case 19: Verify application creates uninstall registry key and values (Req:2.7)

Question: I've used a setup project to create the installer. But the uninstall registry key is not created.

Answer: For Install Location, we need to set ARPINSTALLLOCATION Property through a custom action in our msi. The custom action will set the ARPINSTALLLOCATION to the TargetDir. To do this using Orca we need the following changes to the msi

Step 1:  In the CustomAction table set the following row values:

Action      

Type

Source                                    

Target

MyTargetDir     

51        

ARPINSTALLLOCATION

[TARGETDIR]        

 

Step 2:  In the InstallExecuteSequence table set the following row values: 

Action

Condition

Sequence

MyTargetDir         

ARPINSTALLLOCATION=""                     

798


We can also leave the condition blank in the InstallExecuteSequence.

Certified for Windows Vista logo: Test Case FAQ - Test Case 15

Test Case 15: Verify application installs to the correct folders by default (Req:2.3)

Default install directories are:

Ø       Native x86 and x64 applications

o        Program Files - %ProgramFiles%

o        User’s AppData - %APPDATA%

o        ProgramData – %ALLUSERSPROFILE%

Ø       Win32 applications on x64

o        Program Files - %ProgramFiles(x86)%

o        AppData - %APPDATA%

o        ProgramData – %ALLUSERSPROFILE%

 

Question: Where to store read/write data for all users?

Answer: The suggestion for you is to use the ProgramData (%ALLUSERSPROFILE%) folder (e.g, create ProgramData\<Company>\<Product>) and update the Access Control List (ACL) according to your requirement, during install. The MSDN resource Per-machine Installations at http://msdn2.microsoft.com/en-us/library/aa370810.aspx should be helpful to you.

 

So, if it is ever changing shared DATA (not CODE) then it should logically go in to ProgramData folder. If it is individual DATA then it can go to the user profile. This is suggested with couple of other aspects like security in consideration.

 

Question: How can I change ACL?

Answer: You can refer to the following code snippet to use the DirectorySecurity class to update ACL.

 

private void UpdateACL()

{

     string folderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "MyProgramData");

     try

     {                                                                                      

        System.IO.Directory.CreateDirectory(folderPath);

        System.IO.DirectoryInfo di = new DirectoryInfo(folderPath);

        DirectorySecurity ds = new DirectorySecurity();

        FileSystemAccessRule fACL = new FileSystemAccessRule("MyUser", FileSystemRights.ReadAndExecute,

InheritanceFlags.None, PropagationFlags.None, AccessControlType.Allow); // Please choose the parameters here as per requirement

        ds.SetAccessRule(fACL);

        di.SetAccessControl(ds);

        MessageBox.Show("Folder " + folderPath + " created and updated ACL");

     }

     catch (Exception ex)

     {

          MessageBox.Show("Could not create folder in ProgramData folder.\nReason: " + ex.Message);

     }

}

 

Posted by amitava | 1 Comments

Certified for Windows Vista logo: Test Case FAQ - Test Case 1

Test Case 1: Verify all of the application’s executables contain an embedded manifest that define its execution level (Req:1.1)

This is a basic requirement for an application to run properly in Vista. Vista expects all executables (especially which requires admin right) have a manifest explicitly showing its run level. So an application without such manifest may behave erroneously when accessing protected resources. Applications accessing protected resources without proper manifest may result in virtualization issues.

Question: How we can create embedded manifest?

Answer:

Option #1 – Step-by-step approach

Create a native resource script file (AppName.rc)

#define RT_MANIFEST 24

#define APP_MANIFEST 1

APP_MANIFEST RT_MANIFEST AppName.exe.manifest

Compile the resources using the resource compiler (rc.exe)

rc.exe AppName.rc

Embed the resources to the executable during build process

csc /win32res:AppName.res AppName.cs

vjc /win32res:AppName.res AppName.jsl

vbc /win32resource:AppName.res AppName.vb

Option #2 – Use mt.exe (any language)

mt.exe -manifest AppName.exe.manifest –outputresource:AppName.exe;#1

Option #3 – Specify the manifest file in the Project Properties (C++ only)

Sample manifest:

<?xml version="1.0" encoding="utf-8" ?>

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">

  <assemblyIdentity version="1.0.0.0"

    processorArchitecture="X86"

    name="AppName"

    type="win32" />

  <description>App Description</description>

  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">

    <security>

      <requestedPrivileges>

        <requestedExecutionLevel level="asInvoker" uiAccess="false"/>

  <!-- level=”asInvoker” or level=”requireAdministrator” or level=”highestAvailable”-->

      </requestedPrivileges>

    </security>

  </trustInfo>

</assembly>

 

Question: I have a third party un-manifested file, to which I can't embed. What should I do?

Answer: You can manifest these files externally. For that you need to create a simple text file with the same manifest and name it as <executable name>.exe.manifest and place it in the same folder as that of the exe. You can use/create any such manifest but that should have the following security section to be acceptable.

  <trustInfo xmlns="urn:schemas-microsoft.com:asm.v2">

    <security>

      <requestedPrivileges>

        <requestedExecutionLevel level="asInvoker" />

  <!-- level=”asInvoker” or level=”requireAdministrator” or level=”highestAvailable”-->

      </requestedPrivileges>

    </security>

  </trustInfo>

 

Question: Application fails in Windows XP after a manifest is embedded. How can I rectify?

Answer: <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> should be used instead of .v3

 

Question: Although, we can get our executable manifested, we're getting an error when signing the exe with the signtool.exe.

Answer: You may try to manifest your file from the build event. You can create a post-build event for the project and apply mt to your output exe.

Here is the post-build event command (of the main application) with hard-coded path we tried. One can also achieve the same by using the pre-build event of the setup project.

 

"F:\Program Files\Microsoft SDKs\Windows\v6.0\Bin\mt.exe" -manifest "F:\Projects\TestVistaApp\TestVistaApp\TestVistaApp.manifest" -outputresource:"F:\Projects\TestVistaApp\TestVistaApp\obj\Debug\TestVistaApp.exe"

Please note the exe from the obj folder used in the above command. You can however use the VS environment macros for a generic command.

 

You may use the build event for signing your exe too. You can use the SignTool command with all necessary arguments in the post build event of your project by getting requisite information from some registry location.

 

Reference:

MSDN Blog: http://blogs.msdn.com/cheller/archive/2006/08/24/how-to-embed-a-manifest-in-an-assembly-let-me-count-the-ways.aspx

Certified for Windows Vista logo: Overview

With Windows Vista spreading into the market with a record pace, ISVs need to have their (existing/new) application compatible for Windows Vista. So, Microsoft has set the standard for such compatibility with the premier logo for application certification, Certified for Windows Vista. For the next-generation applications built on Windows Vista, the Certified for Windows Vista program lets customers know that your solution meets a higher standard of quality and exploits the best of what Windows Vista has to offer. Apart from the highest quality logo on compatibility, the ISVs can also look for a lot of other attractive benefits, including partner points, after successful completion of this logo program. This is the reason why more than 500 applications from more than 200 partners been already titled Certified for Windows Vista .

This logo being a standard of highest quality for a desktop-based application, Microsoft has designed a set of strict requirements for these applications to satisfy. Basically, the ISVs can go through a few documents/resources to start working on this premier logo certification.  

  1. Logo eligibility document - briefs the eligibility of an application
  2. Certified for Windows Vista Requirements - provides the basic requirements for this logo
  3. Certified for Windows Vista Test Cases - details the exact technical requirements in the test cases
  4. Innovate On Windows Vista portal - portal for all the Vista logo programs

There is also a dedicated team, in Microsoft, Windows Logo Program for Software (swlogo@microsoft.com) to guide the ISVs through the logo program.

 
Page view tracker