Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Newbies

Reply
 
Thread Tools Search this Thread Display Modes
Old 24th May 2009, 13:58   #1  |  Link
juGGaKNot
Registered User
 
juGGaKNot's Avatar
 
Join Date: Feb 2008
Posts: 733
Detection of OS

I need the command or a program ( that works in .cmd ) that tells me if the os is x86 or x64 ( 32/64 bit ) to make a script for automatic selection of x264.

What should i be looking for ?

thnx, cheers.
juGGaKNot is offline   Reply With Quote
Old 24th May 2009, 17:22   #2  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
If you are on Windows, make a 32-Bit executable and call IsWow64Process() function. Since that function is missing on older Windows versions, we must load it on runtime via GetProcAddress().

They even have the example code attached that should compile directly in VisualStudio (just in case you aren't familiar with C/C++).
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 24th May 2009 at 17:32.
LoRd_MuldeR is offline   Reply With Quote
Old 24th May 2009, 17:30   #3  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
I have attached a binary for you:
http://www.mediafire.com/file/vm2czjemiqt/IsWow64.exe

Code:
int main(int argc, _TCHAR* argv[])
{
  if(IsWow64())
  {
    printf("Running on WOW64\n");
    return 0;
  }
  else
  {
    printf("Running on 32-bit Windows\n");
    return 1;
  }
}
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 24th May 2009 at 17:38.
LoRd_MuldeR is offline   Reply With Quote
Old 24th May 2009, 18:21   #4  |  Link
juGGaKNot
Registered User
 
juGGaKNot's Avatar
 
Join Date: Feb 2008
Posts: 733
Quote:
Originally Posted by LoRd_MuldeR View Post
I have attached a binary for you:
http://www.mediafire.com/file/vm2czjemiqt/IsWow64.exe

Code:
int main(int argc, _TCHAR* argv[])
{
  if(IsWow64())
  {
    printf("Running on WOW64\n");
    return 0;
  }
  else
  {
    printf("Running on 32-bit Windows\n");
    return 1;
  }
}
thnx

btw i am trying to use your makeinstantplayer to make an exe file with redirect but i cant find any readme

i want it to extract to same folder and open a webpage with 2 pages ( 2 links )

"%mypath%\bin\MakeInstantPlayer.exe" "/NOGUI" "/NOSPLASH" "/EXTRACT=%mypath%" "%mypath%\Final_Movie_X264.mp4"

i have all the files from your app in the bin
juGGaKNot is offline   Reply With Quote
Old 24th May 2009, 18:45   #5  |  Link
juGGaKNot
Registered User
 
juGGaKNot's Avatar
 
Join Date: Feb 2008
Posts: 733
Quote:
cd > "dir.txt"
set /p mypath=<"dir.txt"
del "%mypath%\dir.txt"
"%mypath%\bin\win.exe" > "%mypath%\win.txt"
set /p window=<"%mypath%\win.txt"
del "%mypath%\win.txt"
SET x264=spam
"%x264%"
pause
if "%window%"=="Running on 64-bit Windows" GOTO A2
SET x264=x264.x86.exe
GOTO END
:A2
SET x264=x264.x64.exe
GOTO END
:END
Works great, i will not add

"if "%window%"=="Running on 32-bit Windows" GOTO A1"

to force x86 all the time unless its 64.

So :

Quote:
Originally Posted by juGGaKNot View Post
thnx

btw i am trying to use your makeinstantplayer to make an exe file with redirect but i cant find any readme

i want it to extract to same folder and open a webpage with 2 pages ( 2 links )

"%mypath%\bin\MakeInstantPlayer.exe" "/NOGUI" "/NOSPLASH" "/EXTRACT=%mypath%" "%mypath%\Final_Movie_X264.mp4"

i have all the files from your app in the bin
juGGaKNot is offline   Reply With Quote
Old 24th May 2009, 18:54   #6  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by juGGaKNot View Post
thnx

btw i am trying to use your makeinstantplayer to make an exe file with redirect but i cant find any readme

i want it to extract to same folder and open a webpage with 2 pages ( 2 links )

"%mypath%\bin\MakeInstantPlayer.exe" "/NOGUI" "/NOSPLASH" "/EXTRACT=%mypath%" "%mypath%\Final_Movie_X264.mp4"

i have all the files from your app in the bin
Maybe the Readme is a bit unclear here, but the command-line arguments do not belong to MakeInstatPlayer.exe, but to the generated InstantPlayer EXE file
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 24th May 2009, 19:01   #7  |  Link
juGGaKNot
Registered User
 
juGGaKNot's Avatar
 
Join Date: Feb 2008
Posts: 733
Quote:
Originally Posted by LoRd_MuldeR View Post
Maybe the Readme is a bit unclear here, but the command-line arguments do not belong to MakeInstatPlayer.exe, but to the generated InstantPlayer EXE file
So there is no way to make it like i want via cmd ?
juGGaKNot is offline   Reply With Quote
Old 24th May 2009, 19:19   #8  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by juGGaKNot View Post
So there is no way to make it like i want via cmd ?
You must pass the required CLI arguments when calling the player EXE, not when calling MakeInstantPlayer itself.

Also note that /EXTRACT cannot be combined with the other arguments for obvious reasons...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 24th May 2009 at 19:31.
LoRd_MuldeR is offline   Reply With Quote
Old 24th May 2009, 19:40   #9  |  Link
juGGaKNot
Registered User
 
juGGaKNot's Avatar
 
Join Date: Feb 2008
Posts: 733
Quote:
Originally Posted by LoRd_MuldeR View Post
You must pass the required CLI arguments when calling the player EXE, not when calling MakeInstantPlayer itself.

Also note that /EXTRACT cannot be combined with the other arguments for obvious reasons...
Yes my first try was with mplayer.exe

than i saw /NOGUI and i was thinking its for the makeplayer.exe ( as is in the readme for cli usage ... )

thnx

will try
juGGaKNot is offline   Reply With Quote
Old 24th May 2009, 19:49   #10  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by juGGaKNot View Post
Yes my first try was with mplayer.exe

than i saw /NOGUI and i was thinking its for the makeplayer.exe ( as is in the readme for cli usage ... )

thnx
The CLI options listed in the Readme file apply to the self-running player EXE generated by MakeInstantPlayer.exe, but not to MakeInstantPlayer.exe itself.

I will edit the Readme file and make this part more clear in order to avoid confusion...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 24th May 2009, 20:13   #11  |  Link
juGGaKNot
Registered User
 
juGGaKNot's Avatar
 
Join Date: Feb 2008
Posts: 733
the mplayer --help does not have any of these setting

so do you have a example ? something like

mplayer.exe -i file.mp4 -o file.exe options ( "/EXTRACT=folder" )

where i is for opening and o for .exe output ... ?

or "silent" mode for makeinstantplayer.exe ?

LE : aaa you use MakeNSIS v2.44 for this, that was the problem

k going in deep in the MakeNSIS --help.

LE2 : hmm or UPX 3.0, damn, only have one hour to find it lol

LE3 : its too hard, i give up for today.

Quote:
Originally Posted by LoRd_MuldeR View Post
The CLI options listed in the Readme file apply to the self-running player EXE generated by MakeInstantPlayer.exe, but not to MakeInstantPlayer.exe itself.

I will edit the Readme file and make this part more clear in order to avoid confusion...
Yes i see, thnx for the exe

cheers.
juGGaKNot is offline   Reply With Quote
Old 24th May 2009, 21:00   #12  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by juGGaKNot View Post
the mplayer --help does not have any of these setting

so do you have a example ? something like

mplayer.exe -i file.mp4 -o file.exe options ( "/EXTRACT=folder" )
Of course MPlayer doesn't have these settings, because these are NOT options for MPlayer. It's that easy

If you use my MakeInstantPlayer tool to convert a video into a self-running EXE, than that EXE file (and only that one!) will support the CLI options described in the MakeInstantPlayer Readme.

They do not apply to MakeInstantPlayer.exe, MPlayer.exe, MakeNSIS.exe, UPX.exe or anything else, except for the self-running EXE
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 24th May 2009 at 22:41.
LoRd_MuldeR is offline   Reply With Quote
Old 24th May 2009, 23:03   #13  |  Link
J_Darnley
Registered User
 
J_Darnley's Avatar
 
Join Date: May 2006
Posts: 957
What about Windows' environment variable PROCESSOR_ARCHITECTURE ? I don't know what it can be but here it is set to x86
__________________
x264 log explained || x264 deblocking how-to
preset -> tune -> user set options -> fast first pass -> profile -> level
Doom10 - Of course it's better, it's one more.

Last edited by J_Darnley; 24th May 2009 at 23:17.
J_Darnley is offline   Reply With Quote
Old 24th May 2009, 23:44   #14  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 7,806
Would't be easier to just check if x:\%Windir%\SysWOW64 exists????
Atak_Snajpera is offline   Reply With Quote
Old 25th May 2009, 06:45   #15  |  Link
juGGaKNot
Registered User
 
juGGaKNot's Avatar
 
Join Date: Feb 2008
Posts: 733
Quote:
Originally Posted by J_Darnley View Post
What about Windows' environment variable PROCESSOR_ARCHITECTURE ? I don't know what it can be but here it is set to x86
I'd rather use other things, the other

NUMBER_OF_PROCESSORS

does not work on a vista 32 with quad xeon ( it sais 2 not 4 )

So i will have to learn vbs lol.

Quote:
Originally Posted by Atak_Snajpera View Post
Would't be easier to just check if x:\%Windir%\SysWOW64 exists????
Yes but not all people use c for windows so i will have to check no ?

set x264=32
if exists A:\%Windir%\SysWOW64 GOTO X1
if exists B:\%Windir%\SysWOW64 GOTO X1
if exists C:\%Windir%\SysWOW64 GOTO X1
if exists D:\%Windir%\SysWOW64 GOTO X1 .................
:x1
set x264=64
GOTO END
:END
juGGaKNot is offline   Reply With Quote
Old 25th May 2009, 08:32   #16  |  Link
squid_80
Registered User
 
Join Date: Dec 2004
Location: Melbourne, AU
Posts: 1,963
No, %windir% should include the drive letter at the start.

Also, IsWow64Process() is not suitable to detect if the OS is 64-bit, it only reports if the current process is 64-bit. This is noted on the IsWow64Process MSDN page.

Last edited by squid_80; 25th May 2009 at 08:36.
squid_80 is offline   Reply With Quote
Old 25th May 2009, 09:33   #17  |  Link
juGGaKNot
Registered User
 
juGGaKNot's Avatar
 
Join Date: Feb 2008
Posts: 733
Quote:
Originally Posted by squid_80 View Post
No, %windir% should include the drive letter at the start.

Also, IsWow64Process() is not suitable to detect if the OS is 64-bit, it only reports if the current process is 64-bit. This is noted on the IsWow64Process MSDN page.
I see, i only tested 32 bit so far

guess i will go with

set x264=32
if exists "%Windir%\SysWOW64" GOTO X1
GOTO END
:x1
set x264=64
GOTO END
:END

start "encode" /b /low /max /wait "%mypath%\bin\%x264%.exe"

But what if it is dual boot and the folder is there but he is running on the 32 bit ?
juGGaKNot is offline   Reply With Quote
Old 25th May 2009, 10:00   #18  |  Link
dat720
Registered User
 
Join Date: Jan 2008
Posts: 870
Yes but if the process is 64bit then the OS must be 64bit granted if the process is running 32bit under a 64bit OS then it would give a false value.

With VB its very easy to get information like this with a WMI call to Win32_Processor

AddressWidth: 32
Caption: x86 Family 6 Model 23 Stepping 7
DataWidth: 32
Description: x86 Family 6 Model 23 Stepping 7

AddressWidth, Caption, DataWidth, and Description are probably the most useful for processor achitecture, as i was testing that with a virtual machine i can only assume AddressWidth and DataWidth would report 64 under a 64bit Windows but i have no 64bit Windows installs here to test with.

Here... a quick Google search turns this up, it may save you asking so many questions.
http://vlaurie.com/computers2/Articles/environment.htm

C:\Documents and Settings\Administrator>echo %windir%
C:\WINDOWS

Edit:
Confirmed under Vista 64 the values for AddressWidth and DataWidth are 64.

Address Width: 64
Data Width: 64
Description: Intel64 Family 6 Model 23 Stepping 7

Note that the caption and description values are not always present so they may be a bad choice to rely on

Last edited by dat720; 25th May 2009 at 10:13.
dat720 is offline   Reply With Quote
Old 25th May 2009, 10:03   #19  |  Link
dat720
Registered User
 
Join Date: Jan 2008
Posts: 870
Quote:
Originally Posted by juGGaKNot View Post
But what if it is dual boot and the folder is there but he is running on the 32 bit ?
If it is dual boot running in 32bit the folder "%Windir%\SysWOW64" will not exist as the 64bit OS *WILL* be on another partition hence the System drive will be a different letter like D, or if someone was silly enough to dual boot from the same partition it will still not exist as the %windir% variable only contains the Current Windows Directory, a 32bit and 64bit OS cannot reside in the same Directory.

Last edited by dat720; 25th May 2009 at 10:16.
dat720 is offline   Reply With Quote
Old 25th May 2009, 13:00   #20  |  Link
juGGaKNot
Registered User
 
juGGaKNot's Avatar
 
Join Date: Feb 2008
Posts: 733
Quote:
Originally Posted by dat720 View Post
Yes but if the process is 64bit then the OS must be 64bit granted if the process is running 32bit under a 64bit OS then it would give a false value.

With VB its very easy to get information like this with a WMI call to Win32_Processor

AddressWidth: 32
Caption: x86 Family 6 Model 23 Stepping 7
DataWidth: 32
Description: x86 Family 6 Model 23 Stepping 7

AddressWidth, Caption, DataWidth, and Description are probably the most useful for processor achitecture, as i was testing that with a virtual machine i can only assume AddressWidth and DataWidth would report 64 under a 64bit Windows but i have no 64bit Windows installs here to test with.

Here... a quick Google search turns this up, it may save you asking so many questions.
http://vlaurie.com/computers2/Articles/environment.htm

C:\Documents and Settings\Administrator>echo %windir%
C:\WINDOWS

Edit:
Confirmed under Vista 64 the values for AddressWidth and DataWidth are 64.

Address Width: 64
Data Width: 64
Description: Intel64 Family 6 Model 23 Stepping 7

Note that the caption and description values are not always present so they may be a bad choice to rely on
There are about 2-3 months until the programmer will be able to code it, i'm just testing for bitrate and others now.

until then i will use the exe

thnx, cheers all
juGGaKNot is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 20:32.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.