|
|
Today, a tester reported that they were unable to launch a couple of newer executables from one of our desktop apps. By 'unable to launch' I mean that instead of the called executable starting, it was opening a web browser stating that it couldn't find the file. (also some wonderful advice about possible mispelling and refresh) Every other executable in the menu worked correctly.
My first thought was, 'silly tester, it works on my machine!'
My next thought was, security/av interference? Nope, they start on a double-click. It's only a problem when started as a process.
So, two exe's that were failing to launch have one thing in common...the first part of the name which happens to be 'Mosaic'.
I changed the first letter in the filename, adjusted the calling app accordingly and sure enough, it worked.
This just happened, so I'm still trying to figure out what exactly is going on. My guess is that 'Mosaic' in the filename is triggering a browser add-on to fire. I have customers using one of these 'modules' (the other is new) and have not had issues like this, though I don't know for sure if they were using the same OS environment as my tester. (Win11 w/latest patches) I don't have a Win11 system around (still on Win10) so I can't verify if this is a new behavior by design. Googling on the key terms isn't yielding anything useful.
I'm already considering what it will take to change a filename that's been in production for a few years and installed on at least a dozen customer systems. Sure, I've got a process for it, but it's not fun.
Edit: I've just had the same behaviour confirmed on another colleague's Win11 system. 'They hate cans!' (or just files starting with the letters mosaic! Damnit!
Edit 2: After hands-on experimentation on my wife's Win11 laptop, I can confirm that there is an issue using ShellExecute to launch an executable with a filename starting with 'mosaic'. Doing so incorrectly starts a web browser with the message 'Hmmm, I can't find that file...Typo?'. It only happens on Win11 which is just now starting to be adopted by my users. Definitely weird.
"Go forth into the source" - Neal Morse
"Hope is contagious"
modified 3-Jan-23 9:43am.
|
|
|
|
|
Depending on how the image for the new process is identified, it could depend on the CWD and $PATH.
|
|
|
|
|
trønderen wrote: Depending on how the image for the new process is identified, it could depend on the CWD and $PATH.
It should be identified as a win32 executable with a handful of parameters added by the launcher which is calling with the full path and filename.
I've only been able to reproduce the issue on Win11. Changing the filename resolves the issue. I'm waiting for my wife to bring home her Win11 laptop so I can experiment with the issue more.
Again, the issue as I currently see it: with Win11 launching an executable as a process is doing something weird (starting a web browser) when the file name starts with 'Mosaic'. FWIW, the working directory is specified in the command and the executable is signed.
I could believe that some text in a filename might trigger an a/v action, but that doesn't seem to be the case. The file is where it's supposed to be, and runs fine manually. I'll know more later when I get my hands on a Win11 system and can test more thoroughly. I hate to change the filename as it accurately describes the product it interfaces with and what it does.
I absolutely hate problems like this...no logical reason why changing the filename resolves the issue.
Thanks for the suggestions and reply!
"Go forth into the source" - Neal Morse
"Hope is contagious"
|
|
|
|
|
kmoorevs wrote: So, two exe's that were failing to launch have one thing in common...the first part of the name which happens to be 'Mosaic'. Theere's a list of exceptions in Windows for some executables; famously some sim that would not work in W95.
..but no. Just naming it won't trigger that.
kmoorevs wrote: I'm already considering what it will take to change a filename that's been in production for a few years and installed on at least a dozen customer systems To a developer, that costs no time.
If it is that expensive to you, then hire a developer. Let me say that again; you're not fit for your position by your own words.
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Eddy Vluggen wrote: To a developer, that costs no time.
If it is that expensive to you, then hire a developer. Let me say that again; you're not fit for your position by your own words.
Modifying the program is simple. Distributing it (and ensuring that everyone installed the fix) is less so, especially if no provision for online updates was built into the program.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
Daniel Pfeffer wrote: Modifying the program is simple. Distributing it (and ensuring that everyone installed the fix) is less so, especially if no provision for online updates was built into the program. You don't play Warcraft?
If the client isn't up to date, you can't log in. It starts updating as soon as there's a connection, and only presents a login screen if it is up to date.
I disabled auto-updating on Windows ofcourse, but you can't do that with Warcraft. The game is more secure than the platform I'm running it on.
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Your final comment looks pretty spiteful. Is there a need for your nastiness?
|
|
|
|
|
Harsh, yes. No spite.
haughtonomous wrote: Is there a need for your nastiness? Ofcourse there's no need for it.
..and there's no "off" switch either. I'm not going to explain the concept of a "launcher" executable. It's not like we're distributing software on floppy's.
Happy new year BTW.
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Eddy Vluggen wrote: you're not fit for your position by your own words. That was not fair.
Go install World of Warcraft. It will show you an easy fix.
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
First, thank you for your constructive input! I really appreciate it!
Eddy Vluggen wrote: ..but no. Just naming it won't trigger that.
and yet, it does...consistently. Changing the filename changes the behavior.
Second, regarding changing a filename, I never said it was expensive however to a developer (me) it does cost time and requires some planning to make it a seamless transition for my customers.
Third, your unfounded insult means nothing to me. My colleagues and paying clients would disagree with you.
Fourth, I might be hiring for a jr. position. Are you available?
"Go forth into the source" - Neal Morse
"Hope is contagious"
|
|
|
|
|
Long, long ago, a Microsoft operating system only looked at, I think, the first 8 characters of the filename to find a file. But that was long, long ago.
|
|
|
|
|
Good reference to The Jerk!
|
|
|
|
|
I thought someone might get it! Loved that movie! Good catch!
"Go forth into the source" - Neal Morse
"Hope is contagious"
|
|
|
|
|
Huh! Horror story.
Paul Sanders.
If I had more time, I would have written a shorter letter - Blaise Pascal.
Some of my best work is in the undo buffer.
|
|
|
|
|
What is the full filename? I suspect it's something like mosaic:...
|
|
|
|
|
You suspect correctly. They were both Mosaic... Simply adding a couple of letters in front fixes the issue. I can't explain it.
"Go forth into the source" - Neal Morse
"Hope is contagious"
|
|
|
|
|
Could it be that Windows is looking for the name of the executable for reasons of competing browsers? You start the Mosaic browser and it intercepts that launch and shows you the "wonderful world" of IE/Edge.
Granted, Mosaic is about as old as the dirt the internet is made of, so...
|
|
|
|
|
I suspect it's an app execution alias. These are used in Windows 10 and 11. For example, on Win 11, shell-executing "python" will launch the windows store on a default install.
These can be turned off in Apps & Features on the target machine.
Did you try shell executing the full path to the executable (rather than just the filename)?
Gee
|
|
|
|
|
Gee. wrote: Did you try shell executing the full path to the executable (rather than just the filename)?
I was/am setting the working directory in the method calls. That could be a clue though, so thanks!
"Go forth into the source" - Neal Morse
"Hope is contagious"
|
|
|
|
|
Changing CWD can be a pain in the neck (or maybe even lower down).
Even seasoned programmers may believe that they change CWD, complaining that it fails. That is because the way they do it causes a new process to be spun off, and the CWD applies to that process. When it terminates, "Task completed", the changed WD dies with that process. Make sure that the process executing the CWD is not a child process. If you call some API with a CWD parameter, it might start a new process and use the parameter to set the CWD for that process, without affecting the CWD of the calling process.
You have the same situation with the PATH value: A child process cannot modify the path of its ancestor process. It could change the user profile to change the initial PATH for shells started at a later time, but the shell reads the user profile at startup, and is not affected by profile updates while it is running. The same goes for arbitrarily named environment variables.
Most build systems structure a build in a series of job steps, usually with each job step run as a separate process. Countless developers have tried to modify the environment (CWD, PATH or other environment variables) in one job step, expecting the modification to apply to later steps. It fails, even if the the first step updates the user profile. True enough: The next job step process is started after the profile update, but it is (in several build systems, maybe all) a plain child process, not a shell, so it inherits the environment of the build system process that creates it. The user profile is read by the shell when initializing, not at a plain process creation.
In my last job, we had a large crowd of very qualified system developers. Yet, I had to explain again and again why their CWD, PATH and environment updates "failed". I urged them to forget about inheriting the environment by child processes, and rather transfer such values through the Registry, but two thirds of the SW development group were Linux developers by heart, having been forced to accept working under Windows to get a job, bluntly refusing to use any Windows mechanism unknown in Linux if there was any way to avoid it. As long as they could bitch at lengths about the worthless environment handling in Windows, not realizing that a Linux build system would behave in exactly the same way.
So: When you think that you have set the WD of a given process, check it out to be 100% sure: After modifying it, retrieve the CWD to a variable you can inspect in a debugger, or print it out e.g. on the error device.
|
|
|
|
|
It's as good a guess as I've been able to come up with!
I haven't ruled out Cortana intercepting the call and redirecting it to where it thinks (based on the filename?) it needs to go...only to find the callee doesn't live there! As you mentioned, the term 'Mosaic' has been around for a long time in the www lexicon, so I can sorta see a vague connection.
For now, it's a good catch by my tester. I have already adapted (given in) and getting past it. I really only posted here for posterity...on the off-chance that Google may provide it to the next poor sod who can't understand why something (a core win32 method ffs) that has worked for 20 years, suddenly fails on a new Windows version.
Note to my future self: As crazy as it sounds, try changing the filename.
"Go forth into the source" - Neal Morse
"Hope is contagious"
|
|
|
|
|
My freshman year at the Tech. University was the last year of two huge Univac 1100 mainframes as the primary computers for student exercises. Those who have ever worked with the EXEC-8 OS will remember that the file system had "files", which were fairly large disk areas that you organized in "elements" which were e.g. source program units (i.e. what we call "files" in other systems).
Usually, students were given a single such "file" to hold all their work, customary named by the student's name. One of my classmates were refused: Her name was not accepted as a file name, and we could not see the reason.
We asked the system managers, who explained that Exec-8 used a Master File Directory organized as a hash table on the complete file "path" (not a hierarchical one, but a concatenation of a project name and the file name. The code doing the hashing could not handle bucket overflow. So the rejection of my classmate's name really was "Sorry, this hash bucket is full - please select a file name hashing to another bucket!"
|
|
|
|
|
Does it only happen on computers with a certain browser installed?
|
|
|
|
|
Instead of ShellExecute, can you use a different API like CreateProcess?
|
|
|
|
|