gpt4 book ai didi

WiX 为 NetworkService 设置 App_Data 文件夹权限修改

转载 作者:行者123 更新时间:2023-12-04 21:57:32 24 4
gpt4 key购买 nike

我正在努力解决这个问题。我需要通过我的 Wix 安装程序将 ASP.Net 站点中 App_Data 文件夹的权限设置为修改 NetworkService 帐户。我尝试了以下但没有运气。

<CreateFolder>
<util:PermissionEx GenericAll="yes" ChangePermission="yes" Delete="yes"
DeleteChild="yes" User="[WIX_ACCOUNT_NETWORKSERVICE]" />
</CreateFolder>

我也尝试过指定追加,但我收到一条错误消息,指出不允许。

最佳答案

您需要 User="NetworkService"。在支持 PermissionEx 的 SecureObj.cpp 代码中有一个知名用户列表。

    `// figure out the right user to put into the access block
if (!*pwzDomain && 0 == lstrcmpW(pwzUser, L"Everyone"))
{
hr = AclGetWellKnownSid(WinWorldSid, &psid);
}
else if (!*pwzDomain && 0 == lstrcmpW(pwzUser, L"Administrators"))
{
hr = AclGetWellKnownSid(WinBuiltinAdministratorsSid, &psid);
}
else if (!*pwzDomain && 0 == lstrcmpW(pwzUser, L"LocalSystem"))
{
hr = AclGetWellKnownSid(WinLocalSystemSid, &psid);
}
else if (!*pwzDomain && 0 == lstrcmpW(pwzUser, L"LocalService"))
{
hr = AclGetWellKnownSid(WinLocalServiceSid, &psid);
}
else if (!*pwzDomain && 0 == lstrcmpW(pwzUser, L"NetworkService"))
{
hr = AclGetWellKnownSid(WinNetworkServiceSid, &psid);
}
else if (!*pwzDomain && 0 == lstrcmpW(pwzUser, L"AuthenticatedUser"))
{
hr = AclGetWellKnownSid(WinAuthenticatedUserSid, &psid);
}
else if (!*pwzDomain && 0 == lstrcmpW(pwzUser, L"Guests"))
{
hr = AclGetWellKnownSid(WinBuiltinGuestsSid, &psid);
}
else if(!*pwzDomain && 0 == lstrcmpW(pwzUser, L"CREATOR OWNER"))
{
hr = AclGetWellKnownSid(WinCreatorOwnerSid, &psid);
}
else if (!*pwzDomain && 0 == lstrcmpW(pwzUser, L"INTERACTIVE"))
{
hr = AclGetWellKnownSid(WinInteractiveSid, &psid);
}
else if(!*pwzDomain && 0 == lstrcmpW(pwzUser, L"Users"))
{
hr = AclGetWellKnownSid(WinBuiltinUsersSid, &psid);
}
else`

Windows Installer LockPermission 表(WiX 中的 Permission 元素)也支持大多数众所周知的名称,但它们是本地化的,恕我直言,这是一个非常糟糕的设计。这就是 WiX 拥有这个已知列表的原因。

关于WiX 为 NetworkService 设置 App_Data 文件夹权限修改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1527939/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com