Skip to content

Instantly share code, notes, and snippets.

@rxwx
Created June 8, 2022 07:47
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save rxwx/9f6500c7baef98226c2006c6c4b48162 to your computer and use it in GitHub Desktop.
Save rxwx/9f6500c7baef98226c2006c6c4b48162 to your computer and use it in GitHub Desktop.
Create a signed .diagcab file
@echo off
rem Build a .cat file from the .cdf
"c:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\makecat.exe" -v catalog.cdf
rem Sign the .cat file with your codesigning cert
"c:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" sign -a -n "Richard Warren" DiagPackage.cat
rem Package it into a .diagcab file
makecab /d "Troubleshooting=Troubleshooting.diagcab" /f makecab.ddf
rem Optionally sign the .diagcab
"c:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" sign -a -n "Richard Warren" cab\Troubleshooting.diagcab
rem cleanup
del setup.inf
del setup.rpt
del DiagPackage.cat
[CatalogHeader]
Name=DiagPackage.cat
PublicVersion=0x0000001
EncodingType=0x00010001
CATATTR1=0x10010001:OSAttr:2:6.1
[CatalogFiles]
<hash>AdobeUpdater.diagpkg=Troubleshooting.diagpkg
<hash>AdobeUpdater.diagpkgATTR1=0x10010001:Filename:Troubleshooting.diagpkg
<hash>RS_resolver.ps1=RS_resolver.ps1
<hash>RS_resolver.ps1ATTR1=0x10010001:Filename:RS_resolver.ps1
<hash>TS_troubleshooter.ps1=TS_troubleshooter.ps1
<hash>TS_troubleshooter.ps1ATTR1=0x10010001:Filename:TS_troubleshooter.ps1
.Set DiskDirectoryTemplate=cab
.Set CabinetNameTemplate=Troubleshooting.diagcab
Troubleshooting.diagpkg
DiagPackage.cat
RS_resolver.ps1
TS_troubleshooter.ps1
Start-Process calc
<?xml version="1.0" encoding="utf-8"?><dcmPS:AdvDiagnosticPackage SchemaVersion="1.0" Localized="false" xmlns:dcmPS="http://www.microsoft.com/schemas/dcm/package/2007" xmlns:dcmRS="http://www.microsoft.com/schemas/dcm/resource/2007">
<DiagnosticIdentification>
<ID>66badb68-29b1-4b14-a36d-7513bf8e15ae</ID>
<Version>1.0</Version>
</DiagnosticIdentification>
<DisplayInformation>
<Parameters/>
<Name>Troubleshooting</Name>
<Description/>
</DisplayInformation>
<PrivacyLink></PrivacyLink>
<PowerShellVersion>2.0</PowerShellVersion>
<SupportedOSVersion clientSupported="true" serverSupported="true">6.1</SupportedOSVersion>
<Rootcauses>
<Rootcause>
<ID>1</ID>
<DisplayInformation>
<Parameters/>
<Name>Adobe Updater</Name>
<Description/>
</DisplayInformation>
<Troubleshooter>
<Script>
<Parameters/>
<ProcessArchitecture>Any</ProcessArchitecture>
<RequiresElevation>false</RequiresElevation>
<RequiresInteractivity>false</RequiresInteractivity>
<FileName>TS_troubleshooter.ps1</FileName>
<ExtensionPoint/>
</Script>
<ExtensionPoint/>
</Troubleshooter>
<Resolvers>
<Resolver>
<ID>Resolver1</ID>
<DisplayInformation>
<Parameters/>
<Name>Adobe Updater</Name>
<Description></Description>
</DisplayInformation>
<RequiresConsent>false</RequiresConsent>
<Script>
<Parameters/>
<ProcessArchitecture>Any</ProcessArchitecture>
<RequiresElevation>false</RequiresElevation>
<RequiresInteractivity>false</RequiresInteractivity>
<FileName>RS_resolver.ps1</FileName>
<ExtensionPoint/>
</Script>
<ExtensionPoint/>
</Resolver>
</Resolvers>
<Verifier></Verifier>
<ContextParameters/>
<ExtensionPoint/>
</Rootcause>
</Rootcauses>
<Interactions>
<SingleResponseInteractions/>
<MultipleResponseInteractions/>
<TextInteractions/>
<PauseInteractions/>
<LaunchUIInteractions/>
</Interactions>
<ExtensionPoint></ExtensionPoint>
</dcmPS:AdvDiagnosticPackage>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment