Skip to content

Instantly share code, notes, and snippets.

@Colby-PDQ
Created October 18, 2018 18:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Colby-PDQ/6f546c96a6724e6f0aea5b060c401851 to your computer and use it in GitHub Desktop.
Save Colby-PDQ/6f546c96a6724e6f0aea5b060c401851 to your computer and use it in GitHub Desktop.
PDQ Deploy package for uninstalling OpenOffice.
<?xml version="1.0" encoding="utf-8"?>
<AdminArsenal.Export Code="PDQDeploy" Name="PDQ Deploy" Version="17.1.0.0" MinimumVersion="15.0">
<Package>
<CurrentLibraryPackageVersionId value="null" />
<PackageDefinition name="Definition">
<Conditions type="list">
<PackageStepCondition>
<Architecture>Both</Architecture>
<Version>All</Version>
<TypeName>OperatingSystem</TypeName>
</PackageStepCondition>
<PackageStepCondition>
<IsUserLoggedOn>AlwaysRun</IsUserLoggedOn>
<TypeName>LoggedOnUser</TypeName>
</PackageStepCondition>
<PackageStepCondition>
<ConditionMode>None</ConditionMode>
<InventoryCollectionId value="null" />
<InventoryCollectionName></InventoryCollectionName>
<TypeName>Collection</TypeName>
</PackageStepCondition>
</Conditions>
<CopyMode>Default</CopyMode>
<DelayedApprovalTimeSpan>7.00:00:00</DelayedApprovalTimeSpan>
<DownloadApprovalMode>Manual</DownloadApprovalMode>
<InventoryScanProfileId value="null" />
<IsDownloadApprovalModeInherited value="true" />
<ScanAfterDeployment value="null" />
<Steps type="list">
<PowerShellStep>
<CustomCommandLine></CustomCommandLine>
<Files></Files>
<Script>Stop-Process -Force -Name "soffice*"</Script>
<SuccessCodes>0</SuccessCodes>
<RunAs value="null" />
<Conditions type="list">
<PackageStepCondition>
<Architecture>Both</Architecture>
<Version>All</Version>
<TypeName>OperatingSystem</TypeName>
</PackageStepCondition>
<PackageStepCondition>
<IsUserLoggedOn>AlwaysRun</IsUserLoggedOn>
<TypeName>LoggedOnUser</TypeName>
</PackageStepCondition>
<PackageStepCondition>
<ConditionMode>None</ConditionMode>
<InventoryCollectionId value="null" />
<InventoryCollectionName></InventoryCollectionName>
<TypeName>Collection</TypeName>
</PackageStepCondition>
</Conditions>
<ErrorMode>Continue</ErrorMode>
<Title>Kill</Title>
<TypeName>PowerShell</TypeName>
<IsEnabled value="true" />
<IsPostStep value="false" />
<IsPreStep value="false" />
</PowerShellStep>
<InstallStep>
<CustomCommandLine></CustomCommandLine>
<FileName>@(Universal-Uninstall-Path)\Universal Uninstall.ps1</FileName>
<Files></Files>
<IncludeDirectory value="false" />
<LeaveInstallFile value="false" />
<MsiOperation>Install</MsiOperation>
<MsiQuiet value="true" />
<MsiRestart>Never</MsiRestart>
<Parameters>-ProductName "OpenOffice*" -ProductPublisher "Apache Software Foundation"</Parameters>
<SuccessCodes>0,1641,3010,2359302</SuccessCodes>
<RunAs value="null" />
<Conditions type="list">
<PackageStepCondition>
<Architecture>Both</Architecture>
<Version>All</Version>
<TypeName>OperatingSystem</TypeName>
</PackageStepCondition>
<PackageStepCondition>
<IsUserLoggedOn>AlwaysRun</IsUserLoggedOn>
<TypeName>LoggedOnUser</TypeName>
</PackageStepCondition>
<PackageStepCondition>
<ConditionMode>None</ConditionMode>
<InventoryCollectionId value="null" />
<InventoryCollectionName></InventoryCollectionName>
<TypeName>Collection</TypeName>
</PackageStepCondition>
</Conditions>
<ErrorMode>StopDeploymentFail</ErrorMode>
<Title>Uninstall</Title>
<TypeName>Install</TypeName>
<IsEnabled value="true" />
<IsPostStep value="false" />
<IsPreStep value="false" />
</InstallStep>
<PowerShellStep>
<CustomCommandLine></CustomCommandLine>
<Files></Files>
<Script>$AllUsers = Get-ChildItem "C:\Users"
ForEach ( $UserDir in $AllUsers.FullName ) {
ForEach ( $AppDataDir in "Local", "Roaming" ) {
$FinalDir = "$UserDir\AppData\$AppDataDir\OpenOffice"
if ( Test-Path "$FinalDir" ) {
Write-Output "Deleting: $FinalDir"
Remove-Item -Recurse -Force -Path "$FinalDir" -ErrorAction SilentlyContinue | Out-Null
}
}
}</Script>
<SuccessCodes>0</SuccessCodes>
<RunAs value="null" />
<Conditions type="list">
<PackageStepCondition>
<Architecture>Both</Architecture>
<Version>All</Version>
<TypeName>OperatingSystem</TypeName>
</PackageStepCondition>
<PackageStepCondition>
<IsUserLoggedOn>AlwaysRun</IsUserLoggedOn>
<TypeName>LoggedOnUser</TypeName>
</PackageStepCondition>
<PackageStepCondition>
<ConditionMode>None</ConditionMode>
<InventoryCollectionId value="null" />
<InventoryCollectionName></InventoryCollectionName>
<TypeName>Collection</TypeName>
</PackageStepCondition>
</Conditions>
<ErrorMode>StopDeploymentFail</ErrorMode>
<Title>Remove all AppData directories</Title>
<TypeName>PowerShell</TypeName>
<IsEnabled value="true" />
<IsPostStep value="false" />
<IsPreStep value="false" />
</PowerShellStep>
</Steps>
<Timeout value="60" />
<UseCustomTimeout value="false" />
<RunAs value="null" />
</PackageDefinition>
<Description></Description>
<NewLibraryPackageVersionId value="null" />
<OriginalId value="null" />
<Version>1</Version>
<IsAutoDownload value="false" />
<FolderId value="14" />
<LibraryPackageVersionId value="null" />
<Name>Uninstall OpenOffice</Name>
<Path>Uninstall\Uninstall OpenOffice</Path>
<CustomVariables type="list">
<CustomVariable>
<Name>Universal-Uninstall-Path</Name>
<Value>\\Path\To\Universal-Uninstall</Value>
</CustomVariable>
</CustomVariables>
<PackageDisplaySettings name="DisplaySettings">
<DisplayType>Normal</DisplayType>
<IconKey>Icon-Package</IconKey>
<SortOrder value="7" />
</PackageDisplaySettings>
</Package>
</AdminArsenal.Export>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment