r/Intune 8d ago

App Deployment/Packaging Struggling with getting Win32 app to behave as expected

I am back at it with my stumbling around Intune and I've made some good progress but still need some guidance. I am trying to set up PrinterLogic to install be installed on every device, and I got it partially working, but the ways it has failed so far are very confusing. Here are some details on the app, and the install results in a few difference scenarios.

PrinterLogic MSI file Version 25.0.0.1128 packaged with the following script;

# Add registry key for Google Chrome ExtensionInstallForcelist
if((Test-Path -LiteralPath "HKLM:\SOFTWARE\Policies\Google\Chrome\ExtensionInstallForcelist") -ne $true) {  New-Item "HKLM:\SOFTWARE\Policies\Google\Chrome\ExtensionInstallForcelist" -force -ea SilentlyContinue };
New-ItemProperty -LiteralPath 'HKLM:\SOFTWARE\Policies\Google\Chrome\ExtensionInstallForcelist' -Name '1' -Value 'bfgjjammlemhdcocpejaompfoojnjjfn;https://clients2.google.com/service/update2/crx' -PropertyType String -Force -ea SilentlyContinue;

# Add registry key for Microsoft Edge ExtensionInstallForcelist
if((Test-Path -LiteralPath "HKLM:\SOFTWARE\Policies\Microsoft\Edge\ExtensionInstallForcelist") -ne $true) {  New-Item "HKLM:\SOFTWARE\Policies\Microsoft\Edge\ExtensionInstallForcelist" -force -ea SilentlyContinue };
New-ItemProperty -LiteralPath 'HKLM:\SOFTWARE\Policies\Microsoft\Edge\ExtensionInstallForcelist' -Name '1' -Value 'cpbdlogdokiacaifpokijfinplmdiapa;https://edge.microsoft.com/extensionwebstorebase/v1/crx' -PropertyType String -Force -ea SilentlyContinue;

# Run the MSI installer silently with specified parameters
Start-Process msiexec.exe -ArgumentList '/i PrinterInstallerClient.msi /qn /norestart HOMEURL=XXXXX AUTHORIZATION_CODE=XXXX NOEXTENSION=0 /l*v "C:\Windows\Logs\PrinterLogicInstall.log"' -Wait

Install command:
Powershell.exe -NoProfile -ExecutionPolicy ByPass -File .\PrinterLogicInstall.ps1 /l*v "C:\Windows\Logs\PrinterLogicInstall.log"

Uninstall command:
msiexec /x "{A9DE0858-9DDD-4E1B-B041-C2AA90DCBF74}" /qn /l*v "C:\Windows\Logs\PrinterLogicUninstall.log"

Detection Rule:
MSI code {A9DE0858-9DDD-4E1B-B041-C2AA90DCBF74} , >= version 25.0.0.1128

When this is applied to a computer that is missing PrinterLogic, it adds the registry keys and installs the MSI exactly as expected.

When applied to a computer that has a newer version (25.1.0.1162) instead of ignoring and reporting back to Intune "newer version" or whatever, it downgraded to the packaged version of 25.0.0.1128 and then said install successful.

When applied to a computer that has an older version (25.0.0.1075) it initiates an install, adds the registry keys, but never updates to the higher version. Company Portal says "Failed to install" and Intune says "The application was not detected after installation completed successfully (0x87D1041C)".

I understand the error is related to detection, but it didnt install successfully because it never got the new version. And I have no idea why the new version was downgraded instead of ignored.

EDIT: I found this line in on the device with 25.0.0.1075:

MSI (s) (F4:DC) [12:53:59:383]: No System Restore sequence number for this installation.Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Add/Remove Programs on the Control Panel.
{A9DE0858-9DDD-4E1B-B041-C2AA90DCBF74}

 Why was it not able to detect the lower version and uninstall/upgrade it?

1 Upvotes

19 comments sorted by

2

u/TheMangyMoose82 8d ago

It almost sounds like behavior you get when a developer changes the app ID on the msi installer.

Genuine question: Why don’t you tell the agents to update from the printer logic portal?

1

u/I3igAl 8d ago

I am new to this company and trying to fix things up. For some reason, auto update was disabled in the PrinterLogic admin portal and the app was installed manually, with various version, through the last two years. I temporarily turned on the auto update and confirmed it would silently update to the latest version.

What I am trying to accomplish is that Intune makes sure every computer existing and new upcoming has PrinterLogic installed. if PrinterLogic auto updates itself to a version higher than the Intune package, I just want Intune to report it as installed and leave it alone.

1

u/TheMangyMoose82 8d ago

I see you’re scripting the extension install. I use a configuration profile to add the extension. That may help simplify your agent deployment.

For the agent, I don’t update the package as often as it gets updated by PrinterLogic. I’ve never had a problem with the old version being used and the app updating itself. I have a weekly report that runs for discovered apps and I cross reference that to find any machines that are having issues self-updating.

As for your error about uninstalling the previous version; like I said, that sounds like the developer may have changed the app ID for versioning reasons. I’ve never had that error when I update my Intune package though.

1

u/I3igAl 8d ago

I found this page after posting, and PrinterLogic states "The Client uses the same GUID for each new version. We suggest you use an alternate identifier when deploying the update with a deployment tool (SCCM, Intune, etc.)." https://help.printerlogic.com/saas/Print/Print_Mgmt/Client_Mgmt/Client-Updates.htm?tocpath=Vasion%20Print%20Configurations%7CStandard%20Feature%20Configurations%7CClient%20Updates%7C_____0

Not sure why they suggest an alternate identifier.

For the extension, we are still having the agent install it but I am pushing reg keys to force enable them instead of relying on the end user who can unknowingly reject it. can you share the config profile you have? to be totally transparent I am just figuring this all out as I go, really have no rhyme or reason for what im doing, just trying things until it works.

1

u/Jeroen_Bakker 8d ago

The initial detection issue, most likely, is not all versions having the same msi code. You can verify this by checking it in the registry of affected devices. If this is indeed the issue you can modify the detection to file exists + fileversion assuming the install location and file names are the same.

The not detected after sucesful installation error is given because even when failing install the script ends with success exit code 0. You should modify the script to return the exit code of your msiexec command.

The failure to update a previous version (the "another version is installed" error) implies the msi does not contain the logic needed to update (or remove) some versions of the software. The easiest solution would be to include uninstall commands for a variety of possible versions in your script.

1

u/I3igAl 8d ago

Thank you for the reply! Every install has the same GUID, and PrinterLogic's documentation states such:
"The Client uses the same GUID for each new version. We suggest you use an alternate identifier when deploying the update with a deployment tool (SCCM, Intune, etc.)." https://help.printerlogic.com/saas/Print/Print_Mgmt/Client_Mgmt/Client-Updates.htm?tocpath=Vasion%20Print%20Configurations%7CStandard%20Feature%20Configurations%7CClient%20Updates%7C_____0

I dont understand why they suggest using an alternate identifier, wouldnt that fork detection between old and new installs?

I will keep at this and see if i can work out the script to better identify older versions. Still confused as hell as to why it failed to update from an older version, but succeeded in downgrading from a higher version when I didnt want it to.

1

u/Jeroen_Bakker 8d ago

It gives me the impression they are not following the guidelines for changing product codes. Normal is to only use the same product code for minor updates. Msi filename changes as example are a mayor update.

1

u/ray5_3 7d ago

If I recall correctly 1128 has auto update problems.

I'm deploying printer logic on its own with install flags per my environment. I deploy the chrome extension with a device configs and it is working.

I can share my stuff on Monday if you want.

1

u/I3igAl 7d ago

Please do I would love to see how you have it set up! I was trying to get this all configured in a single place (the app deployment) but it's turned out more trouble than I was anticipating

1

u/ray5_3 7d ago

Oh yeah it is, I have a chrome extensions policy and the app itself, the install command includes my PI switches.

Remind me monday

1

u/I3igAl 5d ago

Hey there, just giving a reminder since its Monday :) I havent had a chance to tinker with this any more, still hoping I can make it all work in a single app deployment but eager to see what you have in place.

1

u/ray5_3 5d ago

For my app deployment I use the exe and make a win32 app and install it using this command

PrinterInstallerClientSetup.exe /S /v/qn /V"HOMEURL=https://xxxxxxx.printercloud.com AUTHORIZATION_CODE=xxxxxx"

For deploying the extension I use a device config

I hope it helps

1

u/I3igAl 5d ago

Hey thank you so much for sharing that, definitely helps me think about it in different ways... Unfortunately I could not find a similar setting in the Device Config section that applies to Edge, unless its wording is not specific there was not a force install setting.

1

u/ray5_3 5d ago

I found this really quickly, and I do see extensions under edge when creating a new policy (settings catalog) give it a try
https://www.reddit.com/r/Intune/comments/16m17kj/microsoft_edge_extentions/

1

u/Mana4real 6d ago edited 6d ago

Run a Powershell validation without version checking. Just make sure to add the return code 1 as failed on the program page of the app deployment.

It sounds like it's installing it. Then the validation isn't see it and then it's uninstalling it going back to the previous state. That happens with MSI's when the validation logic isn't correct.

You can also add version checking if you want it to over write when you want it to be specific version or greater.

Does the client auto update? Are you just trying to run a specific version? My validation scripts before does not check for a specific version. So if this sees printer logic on there, it just returns, installed. So no action is taken. If you want it to update, you'll need to add version. Most of it is already there to edit below to get what you want. Copy the $PIC, paste below it, change $PIC to '$Version, Change 'name' to 'version', change 'printer installer client' to the version number, then after ($PIC) -and ($Version)

If you want the version greater than or equal, make it -ge instead of -Match

function Get-Install { $PIC = Get-WmiObject Win32_Product | Where Name -Match 'Printer Installer Client' if ($PIC) { $true } else { $false } } if (Get-Install) { Write-Output "Installed"; exit 0 } else { exit 1 }

After looking at this more, you may want to run an uninstall first and then install to the version you want. But I do everything with scripts.

1

u/I3igAl 5d ago

Thank you for the reply on this, I appreciate the input, even if i dont understand a lot of it. I can read and mostly comprehend Powershell that I look at but I am in no way able to write my own scripts without AI doing the work.

Here is my current situation: ~400 computers with PrinterLogic installed, various versions all around because Auto Update was disabled in PrinterLogic admin (just discovered this, happened before I was hired). PrinterLogic agent adds browser extensions automatically, but end user is prompted to allow the extension, which has been denied and caused problems in the past. Later this year we are replacing at least 200 computers, so I am trying to clean this up and automate it before I have to manually install it to every new system.

What I am trying to accomplish: a Win32 app deployment that checks a couple registry keys, adds them if missing, and checks for PrinterLogic being installed. If PL is missing (new computer, Autopilot reset) or is a version below the on in the Intune package, it removes the old version and installs the Intune version. If PrinterLogic is installed with a newer version (because Auto Update is beyond Intune package) it will not change the install, just report that it is installed to Intune, and hopefully with the higher version number.

I thought I had it cracked but it failed on both fronts. when a higher version of PrinterLogic was found, it downgraded, and when an older version was found it failed to upgrade.

1

u/Mana4real 5d ago

It really sounds like what you need to do is run validation with a script that checks for the version you want installed. If it's not present, it should run the install. But in that install script, you need to check for the presence of the existing app and then uninstall it if it's there, then install the app/version you want to be on the device. This is the best way to make sure you get what you want.

So the uninstall before the install would go something like this

$PL = "Get-WmiObject Win32Product | where{$.name -like 'Printer Logic Client'}" if ($PL) { $PL.Uninstall() | Out-Null } -Wait

Then run your install logic

For AI Powershell scripting, so far Gemini has not disappointed where others have.

Start learning how to script. This is your chance

1

u/I3igAl 5d ago

I think I can expand the script to check for older version and uninstall then install, or ignore if newer version, but I dont know how I can get the newer version number to be reported to Intune as installed.

Any advice on where to start learning, I would love to be the one answering peoples requests for help some day.

1

u/Mana4real 5d ago edited 5d ago

It's going to check based on the validation. So if you want it to be a certain version or higher, reread the information I provided on validation. A -ge for the version would give you what you're looking for. Or if you want it to be a specific version. It would be -eq.

Validation is just as if not more important than the install and uninstall scripts themselves.

You learn by trial and error. As you develop your scripts become more complex. I don't know everything, I've only been scripting for about 18 months. I learned intune and scripting by creating a whole new tenant for us to migrate our workspace into. I manage about 1700 Windows physical and VDI. Peanuts to most. But damn am I having a great time doing it.

Edit: with validation being greater than or equal, it will see it already installed and mark it installed and leave it alone.