无法使用自定义操作将 MSI 安装到用户名中包含非 ascii 字符的非管理员用户
这是我几天来一直在努力解决的问题,现在我已经束手无策了。我正在使用 Wise Installation Studio 创建 MSI,但我敢打赌它可以使用任何 MSI 创作程序进行复制。我为那些希望使用我发布的 MSI、DLL 或 WSI 文件进行重现的人创建了一个测试示例。
- 创建一个新的明智解决方案,另存为“test.wsi”并创建“test.msi”
- 除了在“UI 序列”中的 MigrateFeaturesState 操作之后添加两个自定义操作之外,对此文件不执行任何操作
- 第一个自定义操作是“调用 DLL” “从安装”不传入任何参数并忽略返回代码
- 第二个自定义操作是“从安装调用自定义 DLL”,不传入任何参数并忽略返回代码
- 这两个操作都引用相同的 DLL 和相同的函数 helloworld.dll 和HelloWorld() 函数仅显示“HelloWorld”消息框
预期结果: 两个 hello world 提示,然后是常规 UI 屏幕以开始安装过程。
这是我当前的设置: 开发盒: - 明智安装工作室7.4.0.214 - Win7 x64 在 UAC 关闭的情况下运行,
测试盒: - Windows XP SP3 - Windows 安装程序 v4.5.6001.22159 - .Net Framework v4.0
以下是我的测试用例:
- 使用 ascii 用户名的非管理员 - 'ALLUSERS=""' 和 ALLUSERS="1"
- 管理员的结果均符合预期,名称中包含 unicode 字符 'あくぇえ' - 'ALLUSERS=""' 和 ALLUSERS="1" 名称中带有 unicode 字符的非管理员 '发涩' 的结果均符合预期
- - 仅出现第一个提示,第二个提示显示错误,如下所示: “自定义操作出错。库 C:\Documents and Settings\??[LongAlphaNumericString].TMP\WiseCustomCalla.dll 无效或无法找到。” 'ALLUSERS=""' 和 ALLUSERS="1" 都会发生这种情况,
- 使用另一个管理员登录并将 #3 中的用户设置为 admin,再次使用 #3 中的用户登录,我们得到了预期的结果。
我尝试过强制使用短路径并传递到用户数据文件夹的备用路径,但没有任何效果。有谁知道为什么会发生这种情况以及如何解决它? 我在这里包含了用于此测试的所有文件,其中包括错误消息的屏幕截图、msi 和 msi.xml、wsi 文件、helloworld.dll(使用 rundll32 helloworld.dll、HellowWorld 进行测试)和上述每个测试用例的日志。
http://dl.dropbox.com/u/1797288/error.zip
需要在 MSI/WSI 文件中更改哪些内容,以便 #3 能够正确执行“从安装中调用自定义 DLL”操作?
谢谢, 亚伦·P
This is a problem I have been battling with for a few days and am now at my wits end. I am creating an MSI with Wise Installation Studio but I would bet it could be repro'd with any MSI authoring program. I have created a test sample for those that wish to repro with the MSI, DLL or WSI files that I have posted.
- Create a new wise solution, saved as 'test.wsi' and creates 'test.msi'
- Do nothing to this file except to add two custom actions after the MigrateFeaturesState action in the 'UI Sequence'
- The first custom action is a 'Call DLL From Installation' that passes in no parameters and ignores the return code
- The second custom action is a 'Call Custom DLL From Installation' that passes in no parameters and ignores the return code
- Both actions reference the same DLL and same function, helloworld.dll and HelloWorld() function that just displays a 'HelloWorld' Message box
Expected Result:
Two hello world prompts and then the regular UI screen to start the installation process.
Here is my current setup:
Development Box:
- Wise Installation Studio 7.4.0.214
- Win7 x64 running with UAC turned off,
Test Box:
- Windows XP SP3
- Windows Installer v4.5.6001.22159
- .Net Framework v4.0
Here are my test cases:
- Non-admin with ascii user name - Results are as expected for both 'ALLUSERS=""' and ALLUSERS="1"
- Admin with unicode characters in name 'あくぇえ' - Results are as expected for both 'ALLUSERS=""' and ALLUSERS="1"
- Non-admin with unicode characters in name '发涩' - Only the first prompt appears and an error is displayed for the second as follows:
"Error in custom action. The library C:\Documents and Settings\??[LongAlphaNumericString].TMP\WiseCustomCalla.dll is invalid or could not be found."
This happens for both 'ALLUSERS=""' and ALLUSERS="1" - Login with another admin and set user in #3 to admin, login with user in #3 again and we get the expected results.
I've tried messing around with forcing short paths and passing in an alternate path to the users data folder but nothing works. Anyone know why this is happening and how to fix it?
I've included all the files I used for this testing here, this includes a screen shot of the error message, the msi and msi.xml, the wsi file, the helloworld.dll (test with rundll32 helloworld.dll,HellowWorld) and logs for each test case above.
http://dl.dropbox.com/u/1797288/error.zip
What needs to be changed in the MSI/WSI file so that #3 works correctly for the 'Call Custom DLL from Installation' action?
Thanks,
Aaron P
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为问题是由这些 DLL 的处理方式引起的。安装中的 DLL 存储在二进制表中,并在安装过程中自动提取。它是原生的,所以它可以按预期工作。
从安装中调用自定义 DLL 很可能在安装过程中使用了不正确的路径来提取 DLL。它可能是非管理员用户无法访问的每台计算机的位置。
尝试使用支持 Unicode 字符的代码页构建 MSI(您可以设置 MSI 语言)。另外,尝试创建日志并发布实际的 DLL 路径。
I think the problem is caused by the way these DLLs are handled. A DLL from installation is stored in Binary table and automatically extracted during install. It's native, so it works as expected.
Call custom DLL from installation most likely uses an incorrect path for extracting the DLL during install. It may be a per-machine location which cannot be accessed by a non-admin user.
Try building the MSI with a codepage that supports the Unicode characters (you can set the MSI language). Also, try creating a log and post the actual DLL path.