This forum uses cookies. Click X button to hide this message. What is stored? / Privacy
Total Commander Forum Index Total Commander
Forum - Public Discussion and Support
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Meaningful error message when program start fails
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Total Commander Forum Index -> TC suggestions (English) Printable version
View previous topic :: View next topic  
Author Message
Dalai
Power Member
Power Member


Joined: 28 Jan 2005
Posts: 6046
Location: Meiningen (Südthüringen)

PostPosted: Sun Jun 03, 2018 8:09 am    Post subject: Reply with quote

Uh, this is not about Windows 10. I'm testing on XP (and Win2k where my Delphi is), because it's easier in this particular case.

OK, to summarize: TC 9.20 beta5 shows "Access denied" in its own error dialog (not the Windows one) when trying to launch FB-Traffic on XP - just like it did in previous betas/versions. My test program shows "%1 is not a valid Win32 application", similar to the Windows message when launching the file via TC's context menu. Logic tells me there is something different in TC, maybe FormatMessage doesn't get the message from the system or it's lost somewhere before it gets to the user. As I already said, I don't know what I can do to assist you.

Regards
Dalai
_________________
#101164 Personal licence
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups
Back to top
View user's profile Send private message Send e-mail
j7n
Member
Member


Joined: 07 Aug 2005
Posts: 131

PostPosted: Sun Jun 03, 2018 2:54 pm    Post subject: Reply with quote

Thank you for looking into this issue I have also raised in the past.

I confirm that Beta 5 still doesn't display a correct error message on 2k/XP/2008/Seven for programs that require new subsystem version (increasingly common) or 64-bit machine. It now shows two lines of access denied instead of one like in the past.

Access denied!
"Access is denied."

For 64-bit binaries, x86 NT6.0 provides a helpful message that is a paragraph long (but not shown in TC).

"The version of this file is not compatible with the version of Windows you're running. Check your computer's system information to see whether you need an x86..." (they could simplify and just tell the required version...)

Is it not possible to make double-click perform the same action as launching an exe from explorer/right-click with all error dialogs?

The double error reminds me of doors in video game Half-Life.
_________________
#148174 Personal license
Running Total Commander v8.52a
Back to top
View user's profile Send private message
Dalai
Power Member
Power Member


Joined: 28 Jan 2005
Posts: 6046
Location: Meiningen (Südthüringen)

PostPosted: Mon Jun 04, 2018 9:07 am    Post subject: Reply with quote

j7n wrote:
It now shows two lines of access denied instead of one like in the past.

Access denied!
"Access is denied."

This is done when TC's language differs from the OS language or the error message is potentially different. This should work for "simple" error texts that don't contain placeholders like %1, like the one you mentioned regarding x64 programs on 32 bit Windows.

Quote:
For 64-bit binaries, x86 NT6.0 provides a helpful message that is a paragraph long (but not shown in TC).

Yes, that's another good test case which Ghisler can use. Apparently even that error text isn't shown by TC, because it also contains a placeholder:
Windows wrote:
This version of %1 is not compatible with the version of Windows you're running. Check your computer's system information to see whether you need a x86 (32-bit) or x64 (64-bit) version of the program, and then contact the software publisher.
Note that this error text slightly differs from the one shown by Explorer. Thus I searched where the error texts come from, and it looks like the FormatMessage function reads the error texts (in this case) from kernel32.dll(.mui), while Explorer reads it from shell32.dll(.mui).

Quote:
Is it not possible to make double-click perform the same action as launching an exe from explorer/right-click with all error dialogs?

Well, the goal of this thread is that TC shows the same error text as Windows does, and with the suggested code it can be achieved. Ghisler just needs to find out what he does differently in TC. In the end, it's not the same action, but at least the end result (the error text) is the same.

Regards
Dalai
_________________
#101164 Personal licence
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups
Back to top
View user's profile Send private message Send e-mail
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 35712
Location: Switzerland

PostPosted: Tue Jun 05, 2018 1:45 am    Post subject: Reply with quote

It's probably because I'm not using GetLastError, but instead use the error returned in hInstApp:

Quote:
If the function fails, it is set to an SE_ERR_XXX error value that indicates the cause of the failure.


I will try using GetLastError instead.
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Dalai
Power Member
Power Member


Joined: 28 Jan 2005
Posts: 6046
Location: Meiningen (Südthüringen)

PostPosted: Tue Jun 05, 2018 8:14 am    Post subject: Reply with quote

Aha! Well, you could use both GetLastError and hInstApp, but as I see it, the latter only contains some generic error code that is not really helpful.

Regards
Dalai
_________________
#101164 Personal licence
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups
Back to top
View user's profile Send private message Send e-mail
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 35712
Location: Switzerland

PostPosted: Wed Jun 06, 2018 10:34 am    Post subject: Reply with quote

Yes indeed! In Beta 6, I'm now using GetLastError. Please let me know whether it makes any difference. I have also extended the buffer to 1024 characters.
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
j7n
Member
Member


Joined: 07 Aug 2005
Posts: 131

PostPosted: Wed Jun 06, 2018 1:34 pm    Post subject: Reply with quote

The error message works now in all cases I tried (subsystem, x64, bad certificate). However, a literal "%1" is shown. Maybe you can replace it with the name of the exe file to make the text nicer for non-technical users.
_________________
#148174 Personal license
Running Total Commander v8.52a
Back to top
View user's profile Send private message
Dalai
Power Member
Power Member


Joined: 28 Jan 2005
Posts: 6046
Location: Meiningen (Südthüringen)

PostPosted: Wed Jun 06, 2018 2:52 pm    Post subject: Reply with quote

Ah, what a relief! Finally useful error texts in that message box, thank you!

j7n wrote:
However, a literal "%1" is shown. Maybe you can replace it with the name of the exe file to make the text nicer for non-technical users.

I second that. @Ghisler: I guess that, if you don't want FormatMessage to handle that replacement, a simple StringReplace of %1 with the executable name would be enough. In other words, I wouldn't bother with placeholders starting from %2.

Regards
Dalai
_________________
#101164 Personal licence
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups
Back to top
View user's profile Send private message Send e-mail
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 35712
Location: Switzerland

PostPosted: Thu Jun 07, 2018 3:01 am    Post subject: Reply with quote

I will check it.
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
DrShark
Power Member
Power Member


Joined: 03 Nov 2006
Posts: 1111
Location: Kyiv, 68/262

PostPosted: Thu Jun 07, 2018 3:44 am    Post subject: Reply with quote

It seems following may be related to the issue described here.
I treid to launch exe (c:\ProgramData\Microsoft\Windows\WER\ReportQueue\tc920x32_64_b3.exe) from a dir where NTFS rights don't allow this (at least here on Vista 32 bit) from TC 9.20 beta 6.
TC 9.20 beta 6 on Vista 32 bit still shows simple "Access denied" error:
Code:
---------------------------
Total Commander
---------------------------
Access denied!



"Отказано в доступе."
---------------------------
ОК   
---------------------------

When to try to launch it from context menu, Windows shows following error:
Code:
[Window Title]
C:\ProgramData\Microsoft\Windows\WER\ReportQueue\tc920x32_64_b3.exe
[Content]
Отказано в доступе к указанному устройству, пути или файлу. Возможно,  у вас нет нужных прав доступа к этому объекту.

[ОК]

_________________
Android 4.3.1 no root, kernel 08.09.2016; Vista Home Premium SP2 rus 32 bit
TC #149847 Personal licence

Cuz we're all in this together, We're here to make it right
Back to top
View user's profile Send private message
MarcinW
Power Member
Power Member


Joined: 23 Jan 2012
Posts: 836
Location: Poland

PostPosted: Thu Jun 14, 2018 5:14 am    Post subject: Reply with quote

I can confirm that %1 is replaced with the executable name now Smile
Back to top
View user's profile Send private message Send e-mail
DrShark
Power Member
Power Member


Joined: 03 Nov 2006
Posts: 1111
Location: Kyiv, 68/262

PostPosted: Sat Jun 16, 2018 4:09 am    Post subject: Reply with quote

For my sample case TC 9.20 RC1 now also shows file name in error window:
Code:
---------------------------
Total Commander
---------------------------
Access denied on file
C:\ProgramData\Microsoft\Windows\WER\ReportQueue\tc920x32_64_b3.exe!



"Отказано в доступе."
---------------------------
ОК   
---------------------------
but the error text is still different from one in Windows error window (see original post). Should it be like that?
_________________
Android 4.3.1 no root, kernel 08.09.2016; Vista Home Premium SP2 rus 32 bit
TC #149847 Personal licence

Cuz we're all in this together, We're here to make it right
Back to top
View user's profile Send private message
Dalai
Power Member
Power Member


Joined: 28 Jan 2005
Posts: 6046
Location: Meiningen (Südthüringen)

PostPosted: Sat Jun 16, 2018 9:05 am    Post subject: Reply with quote

I can confirm DrShark's findings. Unfortunately, I don't know why this happens. Even my test program doesn't show anything more than "Access denied" when NTFS permissions don't allow the execution of executables. It seems that GetLastError doesn't help in finding the reason why the execution failed in such a case. I wonder what Explorer does beyond that ...

Regards
Dalai
_________________
#101164 Personal licence
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups
Back to top
View user's profile Send private message Send e-mail
j7n
Member
Member


Joined: 07 Aug 2005
Posts: 131

PostPosted: Sat Jun 16, 2018 9:22 am    Post subject: Reply with quote

The longer message doesn't provide more information. It just repeats the basic error in two long sentences. "Access is denied. Perhaps you don't have access rights." It gives an illusion of more information, but doesn't really say whether the access restriction is on the "device, path or file". I think the two words are sufficient if they aren't shown for the other cases that have nothing to do with "access".
_________________
#148174 Personal license
Running Total Commander v8.52a
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> TC suggestions (English) All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Imprint/Impressum: This site is maintained by Ghisler Software GmbH
Privacy Policy | Datenschutzerklärung | Politique de Confidentialité

Using phpBB © phpBB Group