Support Forum: Get Support for Patch My PC Products and Services

Microsoft Configuration Manager and Intune (Enterprises/Paid) => Support and General Questions (Enterprises Using ConfigMgr and Intune) => Topic started by: Bjerring on April 10, 2024, 07:25:31 AM

Title: OpenVPN - detection fails to find older version?
Post by: Bjerring on April 10, 2024, 07:25:31 AM
Hi

Using intune, I'm trying to update an old version of OpenVPN 2.4.9.i601. Which was installed from a package created with PFsense firewall.

The PatchMyPC detection script says that OpenVPN was not detected. As far as I can tell, the script assumes the openVPN is found under the reg key ..\uninstall\{b0168d30-5fdb-49b3-bd29-8f6d87543786}. However the old version I have installed, did create a key named ..\uninstall\OpenVpn.

Is there anyway I can have a custom detection script or can the detection script be changed?
Title: Re: OpenVPN - detection fails to find older version?
Post by: Hugo Marinho (Patch My PC) on April 10, 2024, 07:52:16 AM
Hi there,

The default scripts, cannot be changed. If you want to change the script yourself, you can do so directly from the Intune Console on the package itself.
We would recommend you to add a community script we created, that ensures that it uninstall any previous versions of software's, as a custom pre-script to the OpenVPN package.

Link to script here - Github (https://github.com/PatchMyPCTeam/Community-Scripts/tree/main/Uninstall/Pre-Uninstall/Uninstall-Software)

For more info on how to add custom scripts to packages, see more details below:
https://patchmypc.com/custom-options-available-for-third-party-updates-and-applications#custom-scripts

Hope to have helped, have a great day! :)
Title: Re: OpenVPN - detection fails to find older version?
Post by: Bjerring on April 10, 2024, 08:15:50 AM
Thanks, but I'm not sure I fully understand how this will help?

I can create my own detection rule that triggers the uninstall script. But as I want to update any existing installations, I would need some way of triggering the PatchMyPC update/install package after the uninstall.

If the user just install the PatchMyPC "OpenVPN" package from intune the existing version is replaced as expected. So I don't think it's an "uninstall" problem. It's a problem with the detection script.

If I change the line below, then the old version of OpenVPN gets detected.

FROM:
if($_.pschildname-eq($m='{b0168d30-5fdb-49b3-bd29-8f6d87543786}'TO:
if($_.pschildname-eq($m='OpenVPN'


Title: Re: OpenVPN - detection fails to find older version?
Post by: Bjerring on April 10, 2024, 09:25:16 AM
I'm going to change the detection script i Intune for now. That will get all old version updated.
Then going forward the default detection script will work again for next updates.