Windows 7 中 Delphi 代码存储在哪里?

发布于 2024-08-20 01:19:23 字数 180 浏览 5 评论 0原文

我刚刚注意到我的一些新的 Delphi 控件安装在 Windows 7 的公共文档文件夹中(TMS Smooth 控件和 Virtual Treeview)。这是否有原因,这是一种约定还是某种做事方式或操作系统所做的事情。

是否有地方可以设置源代码管理的根目录,以便更轻松地与 RAD studio 和 Windows 7 集成?

I just noticed that some of my new Delphi controls get installed in the Public Documents folder in windows 7 (TMS Smooth controls and Virtual Treeview). Is there a reason for this, is this a convention or a few way of doing things or something that the operating system does.

Is there a place where I can set the root of my Source control to so that it integrates with RAD studio and windows 7 easier?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

半岛未凉 2024-08-27 01:19:23

当你编译PAS文件时,编译器会在同一目录下放置一个同名的DCU文件。您可以更改此设置,但默认情况下使用同一目录。在 Windows 7 中,可以虚拟化非提升用户对程序文件夹(及其子文件夹)的写入。这意味着当像 Delphi 这样的程序尝试写入这些文件夹之一时,该文件实际上将写入其他位置,并且在下次运行该程序时可能不可用。

因此,由于编译源文件是您的日常工作,因此将它们安装在默认情况下可写的位置(例如公共文档)是有意义的。

但是,大多数组件安装程序将允许您选择不同的安装位置。只要您选择的文件夹不是“程序”的子文件夹,就可以了。

When you compile a PAS file, the compiler will put a DCU file with the same name in the same directory. You can change this, but the default is to use the same directory. In Windows 7, writes to the Programs folder (and its subfolders) for non-elevated users can be virtualized. This means that when a program, like Delphi, attempts to write to one of these folders, the file will actually be written elsewhere, and may not be available the next time the program is run.

Therefore, since compiling the source files is something you do routinely, it makes sense to install them in a location which is writable by default, like Public Documents.

However, most component installers will allow you to choose a different install location. As long as you choose a folder which is not a subfolder of Programs, you should be OK.

笑饮青盏花 2024-08-27 01:19:23

至于“源代码控制根”,Windows 7 不要求您将其放在任何特定位置,尽管有些人可能更喜欢将源代码保存在用户主文件夹中(C:\Users[您的用户名]) ,我个人更喜欢使用简短的东西,比如 C:\DEV,这对我来说非常有用。

As for your "root of source control", Windows 7 does not require that you put it in any particular place, although some people may prefer to hold their source code in their user home folder (C:\Users[Your User Name]), I personally prefer to use something SHORT, like C:\DEV and this works great for me.

挖个坑埋了你 2024-08-27 01:19:23

这确实是一个品味问题...只是要小心在用户目录中存储大量数据...特别是如果您使用漫游配置文件,因为这些数据将被传送到您登录的每台计算机(并在网络)。有利于备份,但不利于登录/注销时间。

由于您使用源代码控制,对于您的项目,最好从根目录创建一个新目录,并将源代码放置在那里。它不会受到 UAC 的保护(除了第一个目录的初始目录创建之外)。我倾向于在我的计算机上创建一个 C:\DEV 目录,然后创建子目录 C:\DEV\3RDPARTY 和 C:\DEV\SANDBOX,我的所有 3rd 方组件都进入 C:\DEV\3RDPARTY 和我的子目录中Delphi 的“默认”目录指向沙箱,我在其中创建“测试”项目。

如果您开发供公众使用的第三方库,那么您将需要使用公共文档之类的内容,但让用户能够更改目录以匹配他们的偏好。

Its really a matter of taste...just be wary of storing lots of data in your user directory... especially if your using roaming profiles, as this data will get shipped around to each machine you login to (and maintain a copy on the network). Good for backups, bad for login/logout times.

Since your using source control, for your projects, your better off creating a new directory off the root, and placing the source there. It won't be protected by UAC (other than initial directory creation of the first directory). I tend to create a C:\DEV directory on my machines, and then create subdirectories C:\DEV\3RDPARTY and C:\DEV\SANDBOX, all of my 3rd party components go into subdirectorys in C:\DEV\3RDPARTY and my "default" directory for Delphi points to the sandbox, where I create my "test" projects.

If your developing a 3rd party library for public consumption, then your going to want to use something like public documents, but give the user the ability to change the directory to match their preferences.

烏雲後面有陽光 2024-08-27 01:19:23

您指定的文件夹可能是 Windows 7 上 SHGetFolderLocation(CSIDL_COMMON_APPDATA) 结果的一部分。它曾经是 Windows XP 上的 C:\Documents and Settings\All Users\Application Data,并且是正确的位置(根据 MS ) 适用于计算机所有用户的应用程序相关文件。

由于我不与其他人共享我的开发机器,因此我通常将组件安装在其他地方(例如,我的家用机器和笔记本电脑上有一个辅助硬盘驱动器,我用它来做这类事情)。这可以防止在编译文件或创建包时 Vista 和 Win7 上出现 UAC 问题,因为我可以安全地向该目录树上的每个人授予读/写访问权限。

我在工作计算机上使用一个单独的文件夹,位于 C:\ 根目录下,名为 Comps。我将所有第三方和内部组件安装在该组件的子文件夹中,这将它们全部保存在一个位置。

The folder you specified is probably part of the result of SHGetFolderLocation(CSIDL_COMMON_APPDATA) on Windows 7. It's what used to be the C:\Documents and Settings\All Users\Application Data on Windows XP, and is the proper location (according to MS) for application-related files that are applicable to all users of the computer.

Since I don't share my development machines with others, I usually install the components elsewhere (I have a secondary hard drive on my home machine and laptop, for instance, that I use for that kind of stuff). This prevents UAC issues on Vista and Win7 when the files are compiled or packages created, as I can safely give read/write access to everyone on that directory tree.

I use a separate folder on my work machine, off the root of C:\, called Comps. I install all of my third-party and inhouse components in subfolders of that one, which keeps them all in one place.

寄离 2024-08-27 01:19:23

是时候库编写者停止默认写入 .他们可能会选择公共文档,因为 Delphi 本身将编译后的包放在那里,并且因为这是唯一确定可用的可写目录,而不是特定于用户的。
我多年来一直使用 :\Dev\Lib 目录,并设置了适当的权限来存储库,并使用 :\Dev\Src 作为我的项目源(我喜欢短路径)。您不知道您正在使用哪个版本控制系统 - 许多版本实际上并不需要单个根目录,您可以在源代码控制下拥有多个目录树,每个目录树都有自己的根目录。无论如何,拥有清晰的目录结构会有所帮助。

我通常将 BPL 保存在 Delphi 使用的同一共享目录中,因为它已经在路径中并且避免“乱扔”system32 文件夹。
不幸的是,许多组件编写者仍然没有遵循正确的库部署规则,我通常发现的最烦人的问题是:
- dcus 没有单独的文件夹(即 \dcu\D11),dcus 保留在源目录中,在不同的 Delphi 版本之间共享库时没有好处
- 软件包不使用 $LibrarySuffix 设置软件包版本,但仍将其放在软件包源名称中
- BPL 留在包目录中,而不是路径中的目录中。

It was time that library writers stopped to write by default to . They prpbably choose public documents because Delphi itself puts compiled packages there, and because that's the only surely available writable directory which is not user-specific.
I've being using for years a :\Dev\Lib directory with proper permission set where to store libraries, and :\Dev\Src for my projects sources (I like short paths). You don't tell which VCS you're using - many do not really need a single root, you can have multiple directory trees under source control, each with its own root. Anyway having a clear directory structure helps.

I usually keep BPLs in the same shared directory Delphi uses, because it is already in the path and avoids to "litter" the system32 folder.
Unlucky many component writers still do not follow proper rules for library deployment, the most annoying issues I usually find are:
- No separate folders for dcus (i.e. \dcu\D11), dcus are left in the source dir, no good when sharing a library across differend Delphi versions
- Packages not using $LibrarySuffix to set the package version, but still putting it in the package source name
- BPL left in the package directory and not in a directory in the path.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文