possible to check if the x86 programs folder exists?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
jjmafiae
Party member
Posts: 1331
Joined: Tue Jul 24, 2012 8:22 am

possible to check if the x86 programs folder exists?

Post by jjmafiae »

is it possible to check if the x86 programs folder exists on windows?
User avatar
Plu
Inner party member
Posts: 722
Joined: Fri Mar 15, 2013 9:36 pm

Re: possible to check if the x86 programs folder exists?

Post by Plu »

If you use Lua's own io it should be possible, but I don't think love's filesystem can reach there.
jjmafiae
Party member
Posts: 1331
Joined: Tue Jul 24, 2012 8:22 am

Re: possible to check if the x86 programs folder exists?

Post by jjmafiae »

oki, thanks comrade.
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: possible to check if the x86 programs folder exists?

Post by Roland_Yonaba »

Well, why not checking the env variable PATH ?

Code: Select all

local function is_windows()
  return (package.config:sub(1,1) == '\\')
end

local function has_pfx86()
  return is_windows()
	and (os.getenv('PATH'):match('Program Files %(x86%)')~=nil)
end

print('Does the folder Program Files (x86) exist ?', has_pfx86())
User avatar
Boolsheet
Inner party member
Posts: 780
Joined: Wed Dec 29, 2010 4:57 am
Location: Switzerland

Re: possible to check if the x86 programs folder exists?

Post by Boolsheet »

There's also the environment variable ProgramFiles(x86) that points to this directory if it's a 64-bit Windows.
Shallow indentations.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 23 guests