Topic: Getting meta data "MachineType" or "Platform" of any file: x86 vs. x64  (Read 3313 times)

0 Members and 1 Guest are viewing this topic.

Re: Getting meta data "MachineType" or "Platform" of any file: x86 vs. x64
« Reply #20 on: October 31, 2015, 01:42:16 PM »

Mikka

  • Code Baker
  • Chef
  • ***
  • Location: Germany
  • Date Registered: May 2012
  • Posts: 234
Lancelot, I'm content with the Call,FileArch procedure now.

Just one single thing that still annoys me: As currently regular strings are returned, I need to subsequently treat them
to receive: 86, 64 and wn, nd. I'm merely interested in integer values and want to ditch "[Unkno]wn" and "[NotFou]nd".

I'm pondering on an elegant way to do this and what I'd like to have is a simple check for NaN (Not a Number):
Code: [Select]
If,%FileArch%,NaN,Exit,"Something seems to be fucked up"

I want to define an error handler that checks if %FileArch% contains an integer (e.g. 64, 86) - or garbage respectively NaN.

Any suggestions?
« Last Edit: October 31, 2015, 01:42:34 PM by Mikka »

Re: Getting meta data "MachineType" or "Platform" of any file: x86 vs. x64
« Reply #21 on: October 31, 2015, 09:33:16 PM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7010
Hi Mikka,

why not write simple ?
you don't have to use "StrFormat,Right,2"
in fact, to me, it is a "bit" wrong using that, ex: IA64 and AMD64   :wink:


ex:
Code: [Select]
Call,FileArch,SumatraInstallerArch,%DownloadFolder%\sumatrapdf-x64.exe
If,%SumatraInstallerArch%,Equal,Unknown,Exit,"Contact to plugin author - Unknown"
If,%SumatraInstallerArch%,Equal,NotFound,Exit,"Contact to plugin author - NotFound"
If,%SumatraInstallerArch%,Equal,IA64,Exit,"Not supported"
If,%SumatraInstallerArch%,Equal,AMD64,..
If,%SumatraInstallerArch%,Equal,I386,..

« Last Edit: October 31, 2015, 09:33:52 PM by Lancelot »

Re: Getting meta data "MachineType" or "Platform" of any file: x86 vs. x64
« Reply #22 on: October 31, 2015, 09:41:05 PM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7010
@JFX, paraglider

what is right way to detect .net ;)
as far as I know, .net is windows platform independent (correct me if I am wrong)

here is an example
https://www.dropbox.com/s/e13v1iocu3idrvj/201511011134.7z?dl=0

GetExeArch.exe
KeePass.exe
%ErrorLevel%      1
StreamExplorer.exe
%ErrorLevel%      0

peach
KeePass.exe
I386 4.0
%ErrorLevel%      1
StreamExplorer.exe
I386 4.0
%ErrorLevel%      1



%ErrorLevel% 4 for .Net Framework ?

:turtle:

Re: Getting meta data "MachineType" or "Platform" of any file: x86 vs. x64
« Reply #23 on: December 04, 2015, 07:56:01 AM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7010
Update:

Edit:
I just tested some other .net plugins at hand:
Attribute Tweaker
gtools (pserv3 etc)
Junction Link Magic 2
KeePass2
Stream Explorer
WinMD5 2 Eolson

They all need wow64 subsystem side by side with .net.


ShowKeyPlus seem to be better compiled fulfilling .net purpose   :thumbsup:
 better you also test  :great:


Edit2:
following curiosity,
pserv 4 also not requires wow64 anymore fulfilling .net purpose  :thumbsup:

It seems old .net applications requires x86,
 latest ones do not  :wink:

:turtle:

 

Powered by EzPortal