部署在 C:\Windows\System32 中时的屏幕保护程序应用程序抛出异常

Posted

技术标签:

【中文标题】部署在 C:\\Windows\\System32 中时的屏幕保护程序应用程序抛出异常【英文标题】:screen saver application when deployed in C:\Windows\System32 throws exception部署在 C:\Windows\System32 中时的屏幕保护程序应用程序抛出异常 【发布时间】:2013-08-29 15:04:55 【问题描述】:

我编写了一个 wpf 应用程序来创建屏幕保护程序,我将 exe 重命名为 scr。我可以从 bin 目录运行它,或者如果我将它复制到 d 目录。

但是当将它复制到 C:\Windows\System32 并尝试从 cmd 提示符运行它或者我从控制面板 > 所有控制面板项目 > 个性化 > 屏幕保护程序启动它时,它会出现异常,单击 here 获取屏幕拍摄。

我正在使用 Windows 8 机器。

谢谢

【问题讨论】:

【参考方案1】:

问题是屏幕保护程序是为 32 位 cpu 编译的。在 64 位操作系统上的 %WINDIR%\System32 文件夹中只允许 64 位 exe。实际上,我使用的是 Windows7 64bit。

正确放置 32 位屏保的位置是 %WINDIR%\SysWOW64 或使用 Visual Studio 中的“AnyCPU”选项编译,然后您可以安装到 %WINDIR%\System32 中。

【讨论】:

以上是关于部署在 C:\Windows\System32 中时的屏幕保护程序应用程序抛出异常的主要内容,如果未能解决你的问题,请参考以下文章

假设路径C: WINDOWS system32始终存在是否安全?

缺少“C:\Windows\system32\python27.zip”文件

使用 C++ 显示 C:\Windows\System32\config 的内容

c# winforms GetCurrentDirectory 返回 C:\WINDOWS\System32\ 设计错误

找不到 c:\windows\system32\mfc100d.dll

生成 C:\Windows\system32\cmd.exe;C:\Program Files\Git\bin ENOENT