Prevent users from modify/repair/uninstall software via PSADT

Hi Guys,

I’m a newbie to PSADT who is working with a setup.exe with no MSI alternative.

I need to get an application packaged (deployed via SCCM) so that the end user can’t modify/repair/uninstall the application from Programs and Features.

I’ve done this before via MSI/MST but just trying to find out if PSADT can achieve this somehow.

Hi,

go to your Application in SCCM, Right Click - Properties - Deployment Types - Then However you named your PSDATK - Edit - Programs - Delete the Line which is targeting your Uninstall / Modify

For example: Deploy-Application.exe UNINSTALL If you delete this, a user cannot uninstall your application, but you can no longer uninstall it yourself either

Because this is a feature of SCCM, not the PSADT.

Alternatively, you can simply comment out the Uninstall command within your script.

1 Like

Hi again,

i missunterstood your request.

If you want to prevent a User to uninstall your app via Porgrams and Features u have to delete/modify the entry of the app in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ or equivalent

u can just delete the whole Folder or modify it to fit your wishes.

For this Case i recommend other Keys for SCCM to check if an application is installed.

I use this -for example- in my Post Installation:

		[String]$appCurrentDate = Get-Date -Format "dd.MM.yyyy"		
		Set-RegistryKey -Key HKEY_LOCAL_MACHINE\SOFTWARE\SCCM_Software\$appVendor\$appName -Name 'Install' -Value $appRevision -Type String
        Set-RegistryKey -Key HKEY_LOCAL_MACHINE\SOFTWARE\SCCM_Software\$appVendor\$appName -Name 'PackageDate' -Value $appScriptDate -Type String
        Set-RegistryKey -Key HKEY_LOCAL_MACHINE\SOFTWARE\SCCM_Software\$appVendor\$appName -Name 'Publisher' -Value $appScriptAuthor -Type String
        Set-RegistryKey -Key HKEY_LOCAL_MACHINE\SOFTWARE\SCCM_Software\$appVendor\$appName -Name 'Version' -Value $appVersion -Type String
        Set-RegistryKey -Key HKEY_LOCAL_MACHINE\SOFTWARE\SCCM_Software\$appVendor\$appName -Name 'InstallDate' -Value $appCurrentDate -Type String
1 Like

I don’t think there’s a native PSADT way to do this.
The uninstall key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{YourApp-GUID}

There’s several options:
Set NoRemove = 1
and NoModify=1

or Set SystemComponent =1 (DWord)
This just hides the app completely from Programs and Features

The other option is use a GPO or CSP to hide Programs and Features altogether. Users have no business seeing it anyway.

All these options are just registry keys so you can just set the values using a PowerShell line in “Post Config” in PSADT.

2 Likes

I have a function that does the registry massaging for this if anyone is interested.

3 Likes

I would love to see that @That-Annoying-Guy :grinning:

2 Likes

Here you go:

Set NoRemove NoModify NoRepair in Add Remove Programs - The Toolkit / Extensions - PSAppDeployToolkit Community

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

For new MSI installs though, just add this to Execute-MSI:

-AddParameters 'ARPNOREMOVE=1 ARPNOMODIFY=1 ARPNOREPAIR=1'
2 Likes