升级程序在客户端的接入方法和推荐配置
1. 接入方法
将升级程序AutoUpdate.exe放在主程序同级目录。
在主程序运行时合适的时机时,运行下AutoUpdate.exe,并传入参数“/Auto”。进入自动升级模式。
通常程序还支持手动检测升级,及在设置或者关于合适的位置,加入按钮,点击时运行下AutoUpdate.exe,无参数。进入手动升级模式。
2. 支持忽略升级
如果程序想支持忽略升级,及用户不想升级,及在自动运行时 传入“/Auto /BanDisturb" ,升级程序即可忽略非强制升级。
如果想让用户升级,则在服务端配置强制升级即可
3.示例代码(C#)
1 2 3 4 5 6 7 8  |  string strAppDir = AppDomain.CurrentDomain.BaseDirectory; string strUpdateFilePath = string.Format("{0}{1}", strAppDir, "AutoUpdate.exe"); System.Diagnostics.Process exep = new System.Diagnostics.Process(); exep.StartInfo.FileName = strUpdateFilePath; exep.StartInfo.Arguments = "/Auto"; exep.StartInfo.CreateNoWindow = true; exep.StartInfo.UseShellExecute = false; exep.Start(); | 
4.示例代码(C++)
1  | ShellExecute(0, _T("open"), _T("AutoUpdate.exe"), _T("/Auto"), _T(""), SW_SHOWNORMAL); | 

                        
                    