.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Win32::Exe::Manifest 3pm" .TH Win32::Exe::Manifest 3pm "2019-01-21" "perl v5.28.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Win32::Exe::Manifest \- MSWin Application and Assembly manifest handling .SH "VERSION" .IX Header "VERSION" This document describes version 0.15 of Win32::Exe::Manifest, released November 30, 2010. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use Win32::Exe \& my $exe = Win32:::Exe\->new(\*(Aqsomefilepath\*(Aq); \& \& my $manifest = $exe\->get_manifest if $exe\->has_manifest; \& \& # Get themed controls \& $manifest\->add_common_controls; \& \& # Change name \& $manifest\->set_assembly_name(\*(AqMy.App.Name\*(Aq); \& \& # Require Admin permissions \& $manifest\->set_execution_level(\*(AqrequireAdministrator\*(Aq); \& \& # write it out \& $exe\->set_manifest($manifest); \& $exe\->write; \& \& #roll your own \& use Win32::Exe::Manifest \& my $xml = $handmademanifest; \& ...... \& my $manifest = Win32::Exe::Manifest\->new($xml, \*(Aqapplication\*(Aq); \& $exe\->set_manifest($manifest); \& $exe\->write; \& \& #get formatted $xml \& my $xml = $manifest\->output; \& \& #try merge (experimental) \& \& my $mfest1 = $exe\->get_manifest; \& my $mfest2 = Win32::Exe::Manifest\->new($xml, \*(Aqapplication\*(Aq); \& \& $mfest1\->merge_manifest($mfest2); \& \& $exe\->set_manifest($mfest1); \& $exe\->write; \& \& #add a dependency \& my $info = \& { type => \*(Aqwin32\*(Aq, \& name => \*(AqDependency.Prog.Id\*(Aq, \& version => 1.0.0.0, \& language => \*(Aq*\*(Aq, \& processorArchitecture => \*(Aq*\*(Aq, \& publicKeyToken => \*(Aqhjdajhahdsa7sadhaskl\*(Aq, \& }; \& \& $manifest\->add_dependency($info); \& $exe\->set_manifest($manifest); \& $exe\->write; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module parses and manipulates application and assembly manifests used in \s-1MS\s0 Windows executables and DLLs. It is part of the Win32::Exe distribution. .SH "METHODS" .IX Header "METHODS" .SS "Constructors" .IX Subsection "Constructors" \fInew\fR .IX Subsection "new" .PP .Vb 1 \& Win32::Exe::Manifest\->new($xml, $type); .Ve .PP Create a new manifest instance from the manifest xml in \f(CW$xml\fR. The \&\f(CW$type\fR param is optional and may contain 'application' (the default), or 'assembly'. .PP Manifest objects can also be created using Win32::Exe .PP .Vb 2 \& my $exe = Win32:::Exe\->new(\*(Aqsomefilepath\*(Aq); \& my $manifest = $exe\->get_manifest if $exe\->has_manifest; .Ve .SS "Output" .IX Subsection "Output" \fIoutput\fR .IX Subsection "output" .PP .Vb 1 \& my $xml = $manifest\->output; .Ve .PP Returns a formatted \f(CW$xml\fR string containing all edits and changes made using Win32::Exe::Manifest .SS "Application Identity" .IX Subsection "Application Identity" \fIset_assembly_name\fR .IX Subsection "set_assembly_name" .PP .Vb 1 \& $manifest\->set_assembly_name(\*(AqMy.Application.Name\*(Aq); .Ve .PP Set the application or assembly name. The name should take the form of a progid and should not include any spaces. .PP \fIget_assembly_name\fR .IX Subsection "get_assembly_name" .PP .Vb 1 \& my $appname = $manifest\->get_assembly_name; .Ve .PP Return the assembly or application name from the manifest. .PP \fIset_assembly_description\fR .IX Subsection "set_assembly_description" .PP .Vb 1 \& $manifest\->set_assembly_description(\*(AqMy Application Description\*(Aq); .Ve .PP Set the application description. The description is an informative string. .PP \fIget_assembly_decription\fR .IX Subsection "get_assembly_decription" .PP .Vb 1 \& my $desc = $manifest\->get_assembly_description; .Ve .PP Return the assembly description from the manifest. .PP \fIset_assembly_version\fR .IX Subsection "set_assembly_version" .PP .Vb 1 \& $manifest\->set_assembly_version(\*(Aq1.7.8.34456\*(Aq); .Ve .PP Set the application or assembly version. The version should take the form of \&'n.n.n.n' where each n is a number between 0\-65535 inclusive. .PP \fIget_assembly_version\fR .IX Subsection "get_assembly_version" .PP .Vb 1 \& my $version = $manifest\->get_assembly_version; .Ve .PP Return the assembly or application version from the manifest. .PP \fIset_assembly_language\fR .IX Subsection "set_assembly_language" .PP .Vb 1 \& $manifest\->set_assembly_language($langid); .Ve .PP Set the application or assembly language. The language id is the \&\s-1DHTML\s0 language code. If you want to set 'language neutral' then pass \&'*' for the value. .PP see : .PP \fIget_assembly_language\fR .IX Subsection "get_assembly_language" .PP .Vb 1 \& my $langid = $manifest\->get_assembly_language; .Ve .PP Return the assembly or application language from the manifest. If there is no language id in the manifest, the method will return '*' .PP \fIset_assembly_architecture\fR .IX Subsection "set_assembly_architecture" .PP .Vb 1 \& $manifest\->set_assembly_architecture($arch); .Ve .PP Set the application or assembly architecture. Accepted values are : x86 msil ia64 amd64 *. Note the lowercase format. If you want your manifest to be architecture neutral, set architecture to '*'. .PP \fIget_assembly_architecture\fR .IX Subsection "get_assembly_architecture" .PP .Vb 1 \& my $arch = $manifest\->get_assembly_architecture; .Ve .PP Return the assembly or application architecture from the manifest. .SS "Trust and Security" .IX Subsection "Trust and Security" \fIset_execution_level\fR .IX Subsection "set_execution_level" .PP .Vb 1 \& $manifest\->set_execution_level($level); .Ve .PP Set the application execution level. Accepted values are : asInvoker, highestAvailable, requireAdministrator, none. If you pass the value \&'none', any trustInfo section will be removed from the manifest. .PP See .PP \fIget_execution_level\fR .IX Subsection "get_execution_level" .PP .Vb 1 \& my $level = $manifest\->get_execution_level; .Ve .PP Return the application execution level. .PP \fIset_uiaccess\fR .IX Subsection "set_uiaccess" .PP .Vb 1 \& $manifest\->set_uiaccess($needed); .Ve .PP Set the application uiAccess requirement in the trustInfo manifest section. Accepted values are 'true', 'false'. If no trustInfo section exists, one is created with the execution level set to 'asInvoker'. .PP See .PP \fIget_uiaccess\fR .IX Subsection "get_uiaccess" .PP .Vb 1 \& my $accessneeded = $manifest\->get_uiaccess; .Ve .PP Return the uiAccess setting from the trustInfo structure. If no trustInfo structure exists, method returns undef. .SS "Application Dependencies" .IX Subsection "Application Dependencies" \fIset_resource_id\fR .IX Subsection "set_resource_id" .PP .Vb 1 \& $manifest\->set_resource_id($id); .Ve .PP Set the resource Id for the manifest. Valid id's are 1, 2 and 3. The default is 1. Don't set this unless you are fully aware of the effects. .PP See .PP \fIget_resource_id\fR .IX Subsection "get_resource_id" .PP .Vb 1 \& my $id = $manifest\->get_resource_id(); .Ve .PP Return the resource Id for the manifest. .PP \fIadd_common_controls\fR .IX Subsection "add_common_controls" .PP .Vb 1 \& $manifest\->add_common_controls(); .Ve .PP Add a dependency on minimum version 6.0.0.0 of the Microsoft.Windows.Common\-Controls shared library. This is normally done with \s-1GUI\s0 applications to use themed controls on Windows \s-1XP\s0 and above. .PP \fIadd_dependency\fR .IX Subsection "add_dependency" .PP .Vb 1 \& $manifest\->add_dependency($info); .Ve .PP Add a dependency on the assembly detailed in the \f(CW$info\fR hash reference. The contents of \&\f(CW$info\fR should be of the form: .PP .Vb 7 \& my $info = { type => \*(Aqwin32\*(Aq, \& name => \*(AqDependency.Prog.Id\*(Aq, \& version => 1.0.0.0, \& language => \*(Aq*\*(Aq, \& processorArchitecture => \*(Aq*\*(Aq, \& publicKeyToken => \*(Aqhjdajhahdsa7sadhaskl\*(Aq, \& }; .Ve .PP Note that the version should be the least specific that your application requires. For example, a version of '2.0.0.0' would mean the system loads the first matching assembly it finds with a version of at least '2.0.0.0'. .PP See: .PP \fIremove_dependency\fR .IX Subsection "remove_dependency" .PP .Vb 1 \& $manifest\->remove_dependency($progid); .Ve .PP Remove a dependency with the \f(CW$progid\fR. For example, passing a \f(CW$progid\fR of \&'Microsoft.Windows.Common\-Controls' will remove the dependency added via \&'add_common_controls' from the manifest. .PP \fIget_dependency\fR .IX Subsection "get_dependency" .PP .Vb 1 \& my $info = $manifest\->get_dependency($progid); .Ve .PP Return a dependency info hash for a dependency in the manifest with the 'name' \&\f(CW$progid\fR. The info hash is a reference to a hash with the format: .PP .Vb 7 \& { type => \*(Aqwin32\*(Aq, \& name => \*(AqDependency.Prog.Id\*(Aq, \& version => 1.0.0.0, \& language => \*(Aq*\*(Aq, \& processorArchitecture => \*(Aq*\*(Aq, \& publicKeyToken => \*(Aqhjdajhahdsa7sadhaskl\*(Aq, \& }; .Ve .PP If there is no dependency with the name \f(CW$progid\fR, returns undef. .PP \fIget_dependencies\fR .IX Subsection "get_dependencies" .PP .Vb 1 \& my @deps = $manifest\->get_dependencies($progid); .Ve .PP Return an array of hash references, one for each dependency in the manifest. Each member is a reference to a hash with the format: .PP .Vb 7 \& { type => \*(Aqwin32\*(Aq, \& name => \*(AqDependency.Prog.Id\*(Aq, \& version => 1.0.0.0, \& language => \*(Aq*\*(Aq, \& processorArchitecture => \*(Aq*\*(Aq, \& publicKeyToken => \*(Aqhjdajhahdsa7sadhaskl\*(Aq, \& }; .Ve .PP If there are no dependencies, returns an empty array. .SS "Compatibility Settings" .IX Subsection "Compatibility Settings" \fIset_compatibility\fR .IX Subsection "set_compatibility" .PP .Vb 1 \& $manifest\->set_compatibility( (\*(AqWindows Vista\*(Aq) ); .Ve .PP Set the operating system feature compatibility flags. Parameter is a list of operating systems that the application targets. In addition to the opertating system identifier keys, this method also accepts the shorthand strings 'Windows Vista' and 'Windows 7'. .PP See : .PP \fIget_compatibility\fR .IX Subsection "get_compatibility" .PP .Vb 1 \& my @osids = $manifest\->get_compatibility(); .Ve .PP Returns a list of operating system identifier keys that the manifest notes as targeted operating systems. You can convert these os ids to the shorthand strings 'Windows Vista' and 'Windows 7' using the method .PP .Vb 1 \& my $shortstring = $manifest\->get_osname_from_osid($osid); .Ve .PP There is a reverse method .PP .Vb 1 \& my $osid = $manifest\->get_osid_from_osname($shortstring); .Ve .PP \&\s-1NOTE:\s0 Don't set this unless you fully understand the effects. .PP See : .PP \fIset_dpiaware\fR .IX Subsection "set_dpiaware" .PP .Vb 1 \& $manifest\->set_dpdaware( \*(Aqtrue\*(Aq ); .Ve .PP Set section in the manifest if the application is dpi aware. Accepts values true, false, and none. If the value 'none' is passed, the application\ewindowsSettings section is removed from the manifest entirely. .PP See : .PP \fIget_dpiaware\fR .IX Subsection "get_dpiaware" .PP .Vb 1 \& $manifest\->set_dpdaware( \*(Aqtrue\*(Aq ); .Ve .PP Return the dpiAware setting from the manifest, if any. If there is no setting, the method returns undef. .PP See : .SS "Manifest Information" .IX Subsection "Manifest Information" \fIget_manifest_type\fR .IX Subsection "get_manifest_type" .PP .Vb 1 \& my $type = $manifest\->get_manifest_type; .Ve .PP Returns the manifest type ( 'application' or 'assembly' ); .SH "SEE ALSO" .IX Header "SEE ALSO" Modules that use Win32::Exe::Manifest .PP Win32::Exe .SH "AUTHORS" .IX Header "AUTHORS" Mark Dootson .SH "COPYRIGHT & LICENSE" .IX Header "COPYRIGHT & LICENSE" Copyright 2010 by Mark Dootson .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .PP See