有关游戏的部署方案总结(三)

来源:互联网 发布:淘宝劲舞团 编辑:程序博客网 时间:2024/06/06 01:59
1.服务方式运行接收Ctrl+c系统消息(GenerateConsoleCtrlEvent方式)
- 取消进程方式运行,使用写注册表启动启动方式替代


2.需要批量机器维护功能,使用ExitWindowsEx实现。


3.发现注册表启动方式是跟用户绑定的所以就有2个问题
a.每个用户登录都会启动一份
b.重起后没有用户登录就不会运行

解决办法4种,b、c基本等效。考虑到原来的系统,使用了c方法
a.通过绑定端口失败退出保证只启动一份,实现自动登录功能
b.通过gpedit.msc组策略,增加启动脚本(或者只要修改Script.ini和添加脚本就可以了)
c.通过任务计划增加启动时的脚本执行计划
d.所有的都通过服务来实现

4.使用了方法c,脚本如下


net use x: /delete 2>>error.txt
net use x: \\IP\ShareDir "pass" /USER:"user" 2>>error.txt
start x:\xxx.exe xxx

发现net use失败了

通过排查发现net use需要xxx服务。而系统使用启动脚本时,这些服务还没有启动完毕。所以增加等待命令。最后脚本如下.
net use是必须的。因为这个时候还没有登录。在登录以后进行的永久的网络盘映射现在是不可用的。现在进行的映射,登录后也是看不到的。

ping xxxx > NULL
net use x: /delete
net use x: \\IP\ShareDir "pass" /USER:"user"
start x:\xxx.exe xxx

5.登录前启动,网络盘映射都实现了但是发现计算机关机不好用了。原因查msdn上写着这么一段
The ExitWindowsEx function returns as soon as it has initiated the shutdown process. The shutdown or logoff then proceeds asynchronously. 
The function is designed to stop all processes in the caller's logon session. 
Therefore, if you are not the interactive user, the function can succeed without actually shutting down the computer. 
If you are not the interactive user, use the InitiateSystemShutdown or InitiateSystemShutdownEx function.

所以改用InitiateSystemShutdown函数。


6.其他细节罗列
1.windows 2003密码修改。在计算机管理->系统工具->本地用户和组->用户。右键点击对应用户,看到密码修改了吧....
2.远程关机
net use \\ip\IPC$ "pass" /USER:"username"
shutdown /r /m \\IP
3.网络资源访问限制
computer browser服务被禁用,或者没有启用会导致这个问题
原创粉丝点击