App Won't Launch on Windows 10

My Lightwright app has been happily running on both Mac and Windows for many years, but recently I’ve had 4 bug reports that it won’t launch on Windows 10. It’s a 64-bit app, and runs on hundreds of other user’s Windows systems just fine.

3 of the reports are simply that Lightwright doesn’t even launch, with no message from Windows. One other report involves two different computers where one user’s computer runs Lightwright fine, the other fails to launch. The IT guy in that case says both computer’s configurations are identical. Not sure I believe that, but…

I’m baffled, the only thing I can think of is that these computers might be missing the Windows Universal C Runtime, but I am surprised that Windows doesn’t say anything.

Thoughts? Suggestions?

Some additional info came just now. One of my users got a dialog message that says “Unable to execute file: C:\Program Files\Lightwright 6\LW6.exe, CreateProcess failed; code 740. The requested operation requires elevation”

I searched the internet for this message, the only thing I saw was something that applied to .zip files where WinZip couldn’t open the file because the user was already elevated? Lightwright is installed using InnoSetup, FWIW.

To me, that sounds like a permissions thing.
It implies that the app would work if the user was an administrator.

You can ask these people to right-click and ‘run as administrator’ to see what happens.

if that works, its ‘a’ workaround, but the real question is ‘where does it need to write, which is a problem’

You may find that sharing a folder, or granting permissions for the user to folders you access, is enough to do the job.

https://resources.infosecinstitute.com/topic/types-of-user-accounts-in-windows-10-local-domain-microsoft/

Yeah, the first thing I did was have them right-click and choose Run As Administrator, but no luck. I’m going to suggest they take a look at the property of the lw6.exe file and see if they can set it to always run as admin, which might be another way to solve the problem…?

As far as a place to write, that’s been less of an issue on Windows than it has been on Mac lately. When it gets really rough is when an IT department gets in lockdown mode and wants to limit access to pretty much everything, or when all of the data is on a remote drive that needs all kinds of contortions to get to it.

1 Like

[quote=“John_McKernon, post:4, topic:67682”]
Yeah, the first thing I did was have them right-click and choose Run As Administrator, but no luck. I’m going to suggest they take a look at the property of the lw6.exe file and see if they can set it to always run as admin[/quote]

If running as admin didnt work, set it to always run as admin is not going to be any different.

If the problem is permissions and runing as admin does not work, maybe the path you are trying to write requires higher permissions than administrator. Try to right click on the folder you are using and check the security tab, add the admin or the Everyone user with write rights.

Yes windows has no mayor issues. If you write to a private folder for internal files, try to use the SpecialFolder.ApplicationData, for another not changing path, you can set the permissions with inno at the install.

BUT, you should trap all the writing errors in your code, using the iswritable and a Try and show a message tho the user that the access to a file was not successfull.

Do you have any declares in there for CreateProcess or ShellExecute or are you using Shell.Execute for anything?

Ask them to check if they have a different UAC setting between the two machine that behave differently.

Ask if they are running it from an external drive.

Mind you, the writing permissions thing only ‘happens’ if you try to do any writing.
Could it be that it’s simply been blocked/quarantined by some virus checker?

You might want to check and see if they are trying to run your app in terminal services. That is, installed on a server and run under Remote Desktop. That config may require additional permissions.

The only other thing I can think of off the top of my head is to find out if the users are part of a Domain on their network and if their home directories are in fact on a networked drive instead of local. I remember having lots of issues with that at my pre-Xojo job.

No, no CreateProcess or ShellExecute. It’s all pretty vanilla. I’ll ask about the UAC and external drive, thanks!

Interesting idea, no idea why they’d want to do that, but anything is possible.

Thanks!

I checked, I do have two ShellExecute calls, but they’re not called on App launch, they’re only used once to launch a helper app when the user is saving settings to their system registry. Once the settings are in the registry, Lightwright just reads them - and those methods are all heavily trapped for exceptions.

Just to be sure as I don’t see it mentioned above, but are you including the Visual C++ Redistributable with your installer? I don’t know what, if any, specific error messages are shown when this isn’t installed, but I thought it worth mentioning. I think it’s installed via Windows Update in later Windows 10 versions, but better safe than sorry.

https://documentation.xojo.com/topics/windows/information_about_the_windows_universal_runtime.html

Is the message shown right after install just before the first run?

Actually no, I don’t include the Redistributable in the install. I always assumed (perhaps wrongly) that if the redistributable was needed and wasn’t there, that the Xojo app would say something to that effect when it tried to run.

I did ask the users with this problem to make sure they have installed all Windows updates, all say they have…

If I make the redistributable part of the installer, will users running older versions of Windows run into problem with it?

1 Like

For the one user that got that message, the answer is probably yes. However, that user has tried multiple times with the same result, as have the other users who didn’t get the message…

See if Solution 2 helps:

Could it be that the user is running a 32 bit Windows 10 ?

They said they’re running 64-bit, but you never know…

Interesting. What are the ramifications or limitations of using ShellExecute ?

What makes the first run require it?

And this really has me wondering, is why haven’t the other thousands of my users had this problem?

You may also want to ask why antivirus they are using. A couple years ago I found out that AVAST prevented my app from staring without any warning. The app simply did not start.

1 Like