Blog 
Hacking $40k of software just to fix it...
Thursday 11th July 2019
Background:
So, where I work, in my day job, we have a mass spectrometer, (a big machine used to do science!), it's not within my department, so I'm not really pertinent to its operation, at least from an IT professional perspective, I've been fortunate enough to have had a tour of the unit, and be part of the process for high resolution imaging, in layman's terms you can see what kind of particles at an atomic level make up an object.
So, it costs a lot of money.
The whole place really reminds me of the opening chapters of the video game half-life to be honest.
In fact, one of the things I enjoy most about working at this facility, is putting on a lab coat, and pushing a very expensive workstation around on a trolly for deployment, we even have rav4's with the company logo on them, akin to the SUV vehicles in black mesa.
I see, one day I'm going to start a resonance cascade.
Moving on.
The only thing I care about from a support perspective are the x86 based Windows PC's, normally the issue we face are pretty straight forward, a dead power supply here, a new keyboard there, occasionally driver issues dealing with GPIB cards and National Instruments products such as LabVIEW. - you've just gotta use your problem-solving skills, and not be afraid to reach out for help to vendors as needed.

So, here's the issue that came up, this mass spectrometer controller, that is just your run of the mill laptop, run some proprietary software to extract data from the machine itself and puts it in a database of *some type* and displays graphs and data for scientific analysis.
The database component is an open-source component called PostgreSQL, and the proprietary app interfaces with it, and the whole product runs on top of, Windows...
Let's get to running experiments, in this case for data capture, the science team was using the laptop, that came with the unit, it might have been running Windows 7 originally but the problem with Whitebox computers, (what is referred to as a machine, that is, provided by a vendor), are commonly built with off the shelf parts to a minimal spec, is that they don't run an organisation managed SOE, meaning they are subject to whatever crap Microsoft decides the user should have installed, like candy crush! - at some point, it had upgraded to Windows 10.
During one experiment, the machined BSOD, resulting in no data being captured. - this is when I was called in. - I checked the event viewer, nothing obvious, so rerun the experiment, and it crashed again.
Ok, time to reach out to the vendor, my normal course of action in this situation, usually, look at the laptop from this perspective, the laptop is a component in a larger system. - it's easier just to replace it, but I got an interesting email back from the vendor about the licensing, they are based in the US, so there is a time delay, then I got back advice from the vendor about transferring the license to a new device, "Not possible", you'll need to purchase a second license, at the bargain price of $40,000...
No.
I don't care if the software runs in a trial mode and doesn't capture any data, I just want to make sure it won't crash again, I'm trying to eliminate variables here.
Not to worry, in my experience you get used to vendors being pretty useless, so I'm going to dig a little deeper and see if I can figure out the root cause. - and this is when I discovered the compatibility assistant popups.
The notification reads "Compatibility Assistant - PostgreSQL 9.0 may not work correctly - Reinstall this application to fix any problems", every 3 seconds, I guess Windows explorer can't handle the amount of spam, because it just dies after about 20 minutes of use, it also doesn't help that the laptop is just a cheap piece of shit.
So, I made a post to the IT nightmares and greatness Facebook group, to vent my frustration:
Nightmare: $40,000 worth of software on the laptop, runs fine on Windows 10, and uses 3rd party components for SQL... but Windows Compatibility Assistant nofications just won't fucking stahp!! 😩
That was after I had done some troubleshooting regarding Windows Compatibility Assistant.
My post garnered a few responses that I'll share with you, but before that I will mention the plethora of knowledge articles regarding disabling windows compatibility assistance, but nothing official (that you'll find useful) from Microsoft, excluding the Microsoft Support Community, but there are too many posts to mention and none of value.
Yes, I read as much documentation as I could, followed it step by step and it simply didn't work.
Anyway, here are the responses:
- Set the PcaSvc service to 'Disabled' 🙂
I did that after googling it and it didn't stop it, so I made this post. 😛
I'm also just mad at Windows 10 for this.
- Setting it to disabled won't stop the service though. You might want to do that too.., just a friendly reminder which might solve your problem 🙂
Yep, I have dealt with enough grumpy old SysOps in my time to know to check something like that, also did a reboot and re-ran everything as a local administrator, it just doesn't fucking stahp. 🙃
- 40k of software on a laptop? That's seriously f'd up.
It runs a half million-dollar piece of science equipment that's above my pay grade. - Fuck knows what they do with it. ¯\_(ツ)_/¯
40k for software is a bargain in their eyes...
On to solving the problem...
After having contacted the vendor to try and resolve the issue, exhausting all means to disable Windows Compatibility Assistant, even going so far as to contact Microsoft, and being told "we are not sure what's going on there sorry", I attempted to update the PostgreSQL server, but all this did was break the application,
Eventually through trial and error, I figured out the reason why we were getting a notification from the Compatibility Assistant every 3 seconds was due to the way the application talked to the SQL database; it called postgres.exe every 3 seconds for an update, a pulse if you will.
Windows 10 is referring to the 'LegalCopyright' field in the executable file to determine the age of an application, why it does this I have no idea why and it seems a bad programmatic way to do things.
The 'LegalCopyright' field in postgres.exe reads "Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group. Portions Copyright (c) 1994, Regents of the University of California."
So, to fix the issue, I pulled out a hex editor (xvi32), and changed the date from 2010 to 2019.
Windows has now shut up about it, so problem solved. 😂👌
I cannot reconvey the level gratitude that the science department exhibited to me upon returning device, they were jumping for joy at the conclusion of their experiment.
Home | Blog Index | RSS
