'net share' 不适用于法语 Windows OS

'net share' doesn't work on french Windows OS

我正在 windows OS 上编写 NSIS 脚本以在安装时创建共享目录。这是我的代码,它适用于英语 Windows 但不适用于法语 Windows 7.

CreateDirectory C:\tmpShare
nsExec::Exec 'icacls C:\tmpShare /grant *S-1-1-0:(OI)(CI)F'
nsExec::Exec 'net share "tmpShare"="C:\tmpShare" /grant:Everyone,full  /remark:"Temp shared folder"'

原因:法语OS不理解net share命令中的用户名字符串'Everyone',在法语中翻译成'Tout le monde'。

我尝试使用 'Everyone' 的安全 ID,即 *S-1-1-0 而不是字符串 'Everyone',但它不适用于网络共享 (WINDOWS 的糟糕设计,尽管 icacls 可以使用它)

我尝试使用 "Tout de monde" 而不是 'Everyone',它解决了问题,现在的问题是如何编写独立于平台的 NSIS 脚本?

AccessControl plug-in可以为您转换SID:

AccessControl::SidToName "(S-1-1-0)"
Pop 
Pop 
MessageBox MB_OK "Name= Domain="