Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
872 views
in Technique[技术] by (71.8m points)

c++ - windows/System32 or windows/SysWOW64

I have a 32 bit application. How correctly (officially) to find out which folder to install the application, depending on the bit depth of the OS? Are there any winapi commands that would give out the correct path, if i indicating that the application is 32 bit.

windows/System32 or windows/SysWOW64?

In general, how correctly to do, if i'm not want to check if one of this folder exist?

Minimum supported client needed - Windows XP.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You should call SHGetKnownFolderPath supplying FOLDERID_ProgramFiles folder id. It will retrieve correct directory for applications. If you still want to install into system32 (though typical applications should not do it), then you can call it with FOLDERID_SystemX86.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...