通用路径chrome.exe [英] Universal path to chrome.exe

查看:447
本文介绍了通用路径chrome.exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作应用程序,并且希望使用Chrome URL快捷方式将其安装在用户的桌面上。因此,是否有一个通用的chrome.exe路径,可以在所有Windows版本(XP,Seven和Vista)上启动我的应用程序。

I am making an application and I want to make it installable on the user's desktops using chrome URL shortcut. Therefore, is there a universal path to the chrome.exe that can launch my app on all Windows versions ( XP, Seven and vista )

推荐答案

Chrome默认安装到用户的AppData本地文件夹中:

Chrome installs by default to the User's AppData Local folder:

XP:
C:\Documents and Settings\UserName\Local Settings\Application Data\Google\Chrome

Vista:
C:\Users\UserName\AppDataLocal\Google\Chrome

Windows 7:
C:\Program Files (x86)\Google\Application\chrome.exe

更新:
正如评论中所提到的,它显示了 chrome.exe 的路径已更改的的Win7 / 8 即可。它现在位于:
C:\程序文件(x86)\Google\Application\chrome.exe

Update: As mentioned in a comment, it appears the path to chrome.exe has changed in Win7/8. It's now in: C:\Program Files (x86)\Google\Application\chrome.exe

最好的办法是使用一些操作系统检测代码,然后使用环境变量检测用户的AppData文件夹(即%LOCALAPPDATA%)或ProgramFiles文件夹,以及然后将操作系统的差异追加到变量的末尾。

Best bet is to use some OS detection code, then use an environment variable to detect the User's AppData folder (i.e. %LOCALAPPDATA%) or the ProgramFiles folder, and then append the difference in OS's to the end of the variable.

这篇关于通用路径chrome.exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆