Backstory:
We all know it’s time consuming when there is conflicting advanced COM and isolation settings between packages already produced since they all need the same settings to work in a CG.
First you have to open all packages, and then you have to see what’s different before you can make the same adjustment to all the needed packages, it takes time and it easy to forget something.
What we wanted to do:
Tweakappv works basically like a small APPV api, so if you can crack the commands and syntax you can basically edit everything in one or more packages without doing manual editing.
What we managed to do:
Some settings have to be done using xsl transforms, here is the XSL for disabling Brower plugins:
<?xml version="1.0"
encoding="utf-8"?>
<!--
Update appv package manifest using the following
command line:
TweakAppv.exe /update "Your
Application.appv" /transformmanifest AppxManifest.xml
"DisableBrowserHelperObject.xsl"
-->
<xsl:transform version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:appx="http://schemas.microsoft.com/appx/2010/manifest"
xmlns:appv="http://schemas.microsoft.com/appv/2010/manifest"
xmlns:appv1.1="http://schemas.microsoft.com/appv/2013/manifest"
xmlns:appv1.2="http://schemas.microsoft.com/appv/2014/manifest">
<xsl:output method="xml"
version="1.0" omit-xml-declaration="no"
encoding="UTF-8" standalone="yes"
indent="yes"/>
<!-- Copy nodes that are not BrowserPlugin
-->
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates
select="node()|@*"/>
</xsl:copy>
</xsl:template>
<!-- Comment BrowserPlugin -->
<xsl:template
match="/appx:Package/appv:Extensions/*[local-name()='Extension' and
namespace-uri()='http://schemas.microsoft.com/appv/2013/manifest' and
@Category='AppV.BrowserPlugin' and
*[@Subcategory='BrowserHelperObject']]">
<xsl:text
disable-output-escaping="yes"> <!-- </xsl:text>
<xsl:copy>
<xsl:apply-templates
select="node()|@*"/>
</xsl:copy>
<xsl:text
disable-output-escaping="yes"> --> </xsl:text>
</xsl:template>
</xsl:transform>
|
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://schemas.microsoft.com/appx/2010/manifest"
xmlns:appx="http://schemas.microsoft.com/appx/2010/manifest"
xmlns:appv="http://schemas.microsoft.com/appv/2010/manifest"
xmlns:appv1.1="http://schemas.microsoft.com/appv/2013/manifest"
xmlns:appv1.2="http://schemas.microsoft.com/appv/2014/manifest"
version="1.0"
exclude-result-prefixes="appx">
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template
match='/appx:Package/appv:Extensions/appv:Extension[@Category="AppV.Objects"]'
/>
<xsl:template
match="/appx:Package/appv:Extensions">
<xsl:copy>
<xsl:copy-of
select="@*|node()"/>
<appv:Extension
Category="AppV.Objects">
<appv:Objects>
<appv:NotIsolate>
<appv:Object
Name="*" />
</appv:NotIsolate>
</appv:Objects>
</appv:Extension>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
|
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://schemas.microsoft.com/appx/2010/manifest"
xmlns:appx="http://schemas.microsoft.com/appx/2010/manifest"
xmlns:appv="http://schemas.microsoft.com/appv/2010/manifest"
xmlns:appv1.1="http://schemas.microsoft.com/appv/2013/manifest"
xmlns:appv1.2="http://schemas.microsoft.com/appv/2014/manifest"
version="1.0"
exclude-result-prefixes="appx">
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template
match='/appx:Package/appv:Extensions/appv:Extension[@Category="AppV.Objects"]'
/>
</xsl:stylesheet>
|
<xsl:transform
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://schemas.microsoft.com/appx/2010/manifest"
xmlns:appx="http://schemas.microsoft.com/appx/2010/manifest"
xmlns:appv="http://schemas.microsoft.com/appv/2010/manifest"
xmlns:appv1.1="http://schemas.microsoft.com/appv/2013/manifest"
xmlns:appv1.2="http://schemas.microsoft.com/appv/2014/manifest"
version="1.0"
exclude-result-prefixes="appx">
<xsl:param name="VFS"
select="true"/>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates
select="@* | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template
match="appx:Package/appx:Properties/appv1.2:FullVFSWriteMode">
<xsl:copy>
<xsl:value-of
select="$VFS"/>
</xsl:copy>
</xsl:template>
</xsl:transform>
|
;twc
;Appv:ComIsolated
6
;appv:SoftwareClients
7
;appv:Objects
8
Del-Nodes
"AppxManifest.xml" -xpath "appv:ExtensionsConfiguration/appv:COM"
Del-Nodes
"AppxManifest.xml" -xpath "appv:ExtensionsConfiguration/appv:SoftwareClients"
Del-Nodes
"AppxManifest.xml" -xpath "appv:ExtensionsConfiguration/appv:Objects"
;end
;Appv:COMOFF
6,23,24,25
New-Element
"AppxManifest.xml" -elementname "appv:ExtensionsConfiguration" -namespaceURI
"http://schemas.microsoft.com/appv/2010/manifest"
-createifnotexist
New-Element
"AppxManifest.xml" -xpath "appv:ExtensionsConfiguration" -elementname
"appv:COM" -elementtext
" " -namespaceURI
"http://schemas.microsoft.com/appv/2010/manifest"
-createifnotexist
Set-ElementAttribute "AppxManifest.xml" -xpath "appv:ExtensionsConfiguration/appv:COM" -AttributeName
"Mode" -AttributeValue "Off"
;end
;Appv:COMIntegrated
6,23,24,31,32,33-34,35-36
;New-Element
"AppxManifest.xml" -elementname "appv:ExtensionsConfiguration" -namespaceURI
"http://schemas.microsoft.com/appv/2010/manifest"
-createifnotexist
;New-Element
"AppxManifest.xml" -xpath "appv:ExtensionsConfiguration" -elementname
"appv:COM" -elementtext
" " -namespaceURI
"http://schemas.microsoft.com/appv/2010/manifest"
-createifnotexist
New-Element
"AppxManifest.xml" -xpath "appv:ExtensionsConfiguration/appv:COM"
-elementname "appv:IntegratedCOMAttributes"
-elementtext " " -namespaceURI
"http://schemas.microsoft.com/appv/2010/manifest"
-createifnotexist
Set-ElementAttribute "AppxManifest.xml" -xpath "appv:ExtensionsConfiguration/appv:COM" -AttributeName
"Mode" -AttributeValue
"Integrated"
Set-ElementAttribute "AppxManifest.xml" -xpath
"appv:ExtensionsConfiguration/appv:COM/appv:IntegratedCOMAttributes"
-AttributeName "InProcessEnabled"
-AttributeValue "true"
Set-ElementAttribute "AppxManifest.xml" -xpath
"appv:ExtensionsConfiguration/appv:COM/appv:IntegratedCOMAttributes"
-AttributeName "InProcessEnabled"
-AttributeValue "false"
Set-ElementAttribute "AppxManifest.xml" -xpath "appv:ExtensionsConfiguration/appv:COM/appv:IntegratedCOMAttributes"
-AttributeName "OutOfProcessEnabled"
-AttributeValue "true"
Set-ElementAttribute "AppxManifest.xml" -xpath
"appv:ExtensionsConfiguration/appv:COM/appv:IntegratedCOMAttributes"
-AttributeName "OutOfProcessEnabled"
-AttributeValue "false"
;end
;appv:SoftwareClients
7,23,24,42,43,44-45
;New-Element
"AppxManifest.xml" -elementname "appv:ExtensionsConfiguration" -namespaceURI
"http://schemas.microsoft.com/appv/2010/manifest"
-createifnotexist
;New-Element
"AppxManifest.xml" -xpath "appv:ExtensionsConfiguration" -elementname
"appv:SoftwareClients" -elementtext " " -namespaceURI
"http://schemas.microsoft.com/appv/2010/manifest"
-createifnotexist
New-Element
"AppxManifest.xml" -xpath "appv:ExtensionsConfiguration/appv:SoftwareClients"
-elementname "appv:ClientConfiguration"
-elementtext " " -namespaceURI
"http://schemas.microsoft.com/appv/2010/manifest"
-createifnotexist
Set-ElementAttribute "AppxManifest.xml" -xpath "appv:ExtensionsConfiguration/appv:SoftwareClients" -AttributeName
"Enabled" -AttributeValue
"false"
Set-ElementAttribute "AppxManifest.xml" -xpath
"appv:ExtensionsConfiguration/appv:SoftwareClients/appv:ClientConfiguration"
-AttributeName "EmailEnabled"
-AttributeValue "true"
Set-ElementAttribute "AppxManifest.xml" -xpath "appv:ExtensionsConfiguration/appv:SoftwareClients/appv:ClientConfiguration"
-AttributeName "EmailEnabled"
-AttributeValue "false"
;end
;appv:Objects
8,23,50,51,52
;New-Element
"AppxManifest.xml" -elementname "appv:ExtensionsConfiguration" -namespaceURI
"http://schemas.microsoft.com/appv/2010/manifest"
-createifnotexist
New-Element
"AppxManifest.xml" -xpath "appv:ExtensionsConfiguration" -elementname
"appv:Objects" -elementtext
" " -namespaceURI
"http://schemas.microsoft.com/appv/2010/manifest"
-createifnotexist
New-Element
"AppxManifest.xml" -xpath "appv:ExtensionsConfiguration" -elementname
"appv:ApplicationCapabilities" -elementtext " " -namespaceURI
"http://schemas.microsoft.com/appv/2010/manifest"
-createifnotexist
Set-ElementAttribute "AppxManifest.xml" -xpath "appv:ExtensionsConfiguration/appv:Objects" -AttributeName
"Enabled" -AttributeValue
"false"
;end
|