在安装项目中为多个 Windows 版本创建自定义文件夹
将安装和使用我创建的应用程序的用户可能不必访问 Program Files 文件夹。因此,我和我的老板认为最好将SQLite数据库放在公共位置,而不是桌面。我们正在考虑“所有用户”配置文件上的“应用程序数据”文件夹,但当我到达另一台计算机时,我意识到该计算机的操作系统可以是 XP 或 Vista 及更高版本。因此,我需要根据版本更改我的数据库文件夹。当处于安装项目的文件系统视图中时,它自然具有应用程序文件夹 ([ProgramFilesFolder][Manufacturer]\[ProductName])、用户桌面 (DesktopFolder) 和用户程序菜单 (ProgramMenuFolder)。公共/所有用户文件夹是否有快捷方式名称?我无法找到一个,虽然我知道我可以相当容易地进行两个单独的安装,但我只是想知道是否有一种方法可以这样做。我的代码中已经有一些 if 语句来确定在哪里查看,我现在只需在设置项目中弄清楚它。谢谢。
The users that will be installing and using the application I created may not have to access to the Program Files folder. Therefore, my boss and I thought it best that we put the SQLite database in a public location, but not the desktop. We were thinking of the Application Data folder on the All Users profile, but when I got to my other computer, I realized that the OS of the computer could be either XP or Vista and higher. Therefore, I need my database folder to change based on version. When in the File System view for the setup project, it naturally has an Application Folder ([ProgramFilesFolder][Manufacturer]\[ProductName]), User's Desktop (DesktopFolder), and User's Programs Menu (ProgramMenuFolder). Is there any shortcut name for the Public/All users folder? I'm unable to find one and while I know I could make two separate installations rather easily, I am just curious to know if there's a way to do it this way. I already have some if statements in my code to determine where to look, I just have to figure it out now in the setup project. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用“变量”,但硬编码路径是禁忌
There are "variables" you can use, hardcoding paths is a no-no