部署C#/ Silverlight 5“浏览器外”应用程序

介绍 (Introduction)

我们从第三方购买了定制修改的C#/ Silverlight 5应用程序。 此程序旨在在处于连接状态(WiFi或3G)或断开连接时,在远程Windows 8 Pro计算机上处​​理维护工作指令。 Silverlight应用程序存储用于存储从移动服务器下载的所有工作订单,零件,历史记录,注释和人工数据。

The source code for the application is stored in a GIT repository on Bitbucket.org, so modifications can be made by either the third party or our programmers. With the explosive growth of software development in the Cloud, this is becoming an increasingly common situation. With the increased use of Agile programming techniques, new versions or releases are delivered more frequently as well. Add to that the complexity of deploying the software on a regular basis to a variety of hardware and software platforms necessitated by the increased use of mobile devices.   

该应用程序的源代码存储在Bitbucket.org上的GIT存储库中,因此可以由第三方或我们的程序员进行修改。 随着云中软件开发的爆炸性增长,这种情况越来越普遍。 随着对敏捷编程技术的越来越多的使用,新版本或发行版本也越来越频繁地交付。 另外,由于越来越多地使用移动设备,需要定期将软件部署到各种硬件和软件平台上,这很复杂。

Because of all of the above, the IT department is frequently required to deploy new and updated software, which in this case proved to be a difficult and uneven process. We eventually got it to work properly through several months of trial and error. By following the techniques in this article others may avoid the costly mistakes and problems we encountered. Cheers.

由于上述所有原因,经常需要IT部门部署新的和更新的软件,在这种情况下,事实证明这是一个困难且不平衡的过程。 经过几个月的反复试验,我们最终使它正常工作。 通过遵循本文中的技术,其他人可以避免我们遇到的代价高昂的错误和问题。 干杯。

部署方式 (Deployment)

软件修改和部署过程如下:

1.      Verified (tested and approved on a local machine) code changes are committed and pushed to the Bitbucket repository.

1.提交经过验证(在本地计算机上测试和批准)的代码更改,并将其推送到Bitbucket存储库。

2.      The current master codebase is pulled from the Bitbucket GIT repository to the local repository on a virtual machine with a custom development environment. We are using the free SourceTree software from Atlassian to process the codebase.

2.当前主代码库从Bitbucket GIT存储库中拉到具有自定义开发环境的虚拟机上的本地存储库中。 我们正在使用Atlassian提供的免费SourceTree软件来处理代码库。

3.      A build is created using the “deploy.msbuild” xml script provided by the vendor, embedded in a custom script (“prod.bat” for production) which includes these steps:

3.使用供应商提供的“ deploy.msbuild” xml脚本创建构建,该脚本嵌入到自定义脚本(用于生产的“ prod.bat”)中,该脚本包括以下步骤:

a.      Turn off the background windows service on the server to avoid file locking.

一个。 关闭服务器上的后台Windows服务,以避免文件锁定。

b.      Create the build: “C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild deploy.msbuild /p:Configuration=Production”

b。 创建内部版本:“ C:\ Windows \ Microsoft.NET \ 框架\ v4.0.30319 \ msbuild deploy.msbuild / p:配置=生产 n”

c.      Move the resulting zip file to the server

C。 将生成的zip文件移动到服务器

d.      Create a temporary directory to hold the uncompressed files from the zip file.

d。 创建一个临时目录来保存zip文件中的未压缩文件。

e.      Expand the zip file into the temporary directory.

e。 将zip文件展开到临时目录中。

f.      Copy and replace the original directory with the contents of the temporary directory.

F。 复制原始目录并将其替换为临时目录的内容。

g.      Remove the temporary directory.

G。 删除临时目录。

h.      Restart the background Windows service.

H。 重新启动后台Windows服务。

i.      Move the build zip file to the archive, renaming by appending current date and time.

一世。 将构建zip文件移动到存档中,并通过附加当前日期和时间进行重命名。

4.      On each mobile client device (this process needs to be automated – it is extremely tedious and time-consuming):

4.在每个移动客户端设备上(此过程需要自动化-这非常繁琐且耗时):

a.      Uninstall the application through the control panel, which completes the following steps (actual file name replaced by “999999999”):

一个。 通过控制面板卸载应用程序,该操作完成以下步骤(实际文件名替换为“ 999999999”):

i.      Deletes the application from C:\Users\\AppData\Local\Microsoft\Silverlight\OutOfBrowser\999999999.mobile

一世。 从C:\ Users \\ AppData \ Local \ Mi删除应用程序 crosoft \ Si lverlight \ 借出 er \ 9999999 99.mobile

ii.      Deletes the shortcut from the desktop

ii。 从桌面删除快捷方式

iii.      Removes the key from the registry at HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\99999999.mobile

iii。 从注册表中的HKEY_CURRENT_USER \ Software中删除密钥 \微软 \ Windows \ C urrentVers 离子\未安装 全部\ 999999 99.mobile

b.      Delete the Silverlight isolated storage (C:\Users\\AppData\LocalLow\Microsoft\Silverlight\is):

b。 删除Silverlight隔离存储(C:\ Users \\ AppData \ LocalLo w \ Microsof t \ Silverli ght \ is):

i.      start the Silverlight Configuration application

一世。 启动Silverlight配置应用程序

ii.      select the Application Storage tab

ii。 选择“应用程序存储”选项卡

iii.      select the specific app’s web site and click the “Delete…” button or click the “Delete all…” button.

iii。 选择特定应用程序的网站,然后单击“删除...”按钮或单击“全部删除...”按钮。

iv.      Click the “OK” button.

iv。 点击“确定”按钮。

c.      Clear the Internet Explorer (IE) browser cache – if you don’t do this, the previous version of the app will continue to run until the cache expires. This seems illogical if the program runs “out of browser”, but is true none-the-less based on my experience. I kept rebuilding over and over because the new version refused to deploy until I finally discovered, with the help of others, the “204” lines in the Fiddler debug tool, indicating that the cached version of several of the files were being loaded when the program was started. I found that I needed to UN-CHECK “Preserve Favorites website data” and CHECK “Temporary Internet files and website files” in order to get the newest version to run. On IE 10, go to “Tools” or the gear icon, “Internet Options”, click the “Delete…” button under “Browsing history” on the “General” tab. UN-CHECK and CHECK the respective boxes detailed above, then click the “Delete” button. Wait awhile for the process to finish before proceeding.

C。 清除Internet Explorer(IE)浏览器缓存-如果您不这样做,则该应用程序的先前版本将继续运行,直到缓存过期。 如果该程序“不在浏览器中”运行,这似乎是不合逻辑的,但根据我的经验还是如此。 我不断地进行重建,因为直到我最终在其他人的帮助下,最终在Fiddler调试工具中发现“ 204”行时,新版本才拒绝部署,这表明在加载某些文件的缓存版本时,程序已启动。 我发现我需要取消选中“保留收藏夹网站数据”和选中“ Internet临时文件和网站文件”,以便运行最新版本。 在IE 10上,转到“工具”或齿轮图标“ Internet选项”,单击“常规”选项卡上“浏览历史记录”下的“删除...”按钮。 取消选中并选中上面详细说明的各个框,然后单击“删除”按钮。 请稍等片刻,以完成该过程,然后再继续。

5.      Install the program on each client device:

5.在每个客户端设备上安装程序:

a.      I deployed the Silverlight application using the “Publish” option in Visual Studio and used an HTTP link as the method of installation, so the program can be installed on the mobile device by clicking a link or typing the http:// string into the address bar of IE.

一个。 我使用Visual Studio中的“发布”选项部署了Silverlight应用程序,并使用HTTP链接作为安装方法,因此可以通过单击链接或在地址中键入http://字符串将程序安装在移动设备上IE浏览器

b.      Click on the “Yes” button of the ensuing page, then the “Install” button on the Security Warning window if necessary.

b。 单击随后页面的“是”按钮,然后在必要时单击“安全警告”窗口中的“安装”按钮。

c.      The program will install and run.

C。 该程序将安装并运行。

附录 (Appendix)

Prod.bat requires 7zip (replace bracketed(<>)  names with actual ones):

Prod.bat需要7zip(用实际的括号替换(<>)名称):

sc \\ stop

sc \\停止

sc \\ queryex

sc \\ queryex

cd \

光盘\

C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild deploy.msbuild /p:Configuration=Production

C:\ Windows \ Microsoft.NET \ F 拼写\ v 4.0.30319 \ msbuild deploy.msbuild / p:配置=生产 ñ

move /Y c:\tmp\publish\*.zip \\\E$\\

移动/ Y c:\ tmp \ publish \ *。zip \\\ E $ \\

mkdir \\\e$\\Temp

mkdir \\\ e $ \\ Temp

cd \Program Files\7-Zip\

cd \ Program Files \ 7-Zip \

7z x -y -o\\\E$\\Temp \\\E$\CGPlatform\*.zip

7z x -y -o \\\ E $ \\ Temp \\\ E $ \ CGPlatform \ *。zip

xcopy \\\e$\\Temp\*.* e:\CGPlatform\*.* /S/Y/F/H/R

xcopy \\\ e $ \\ Temp \ *。* e:\ CGPlatform \ *。* / S / Y / F / H / R

rmdir \\\e$\\Temp /S/Q

rmdir \\\ e $ \\ Temp / S / Q

sc \\ start

sc \\开始

sc \\ queryex

sc \\ queryex

move /Y \\\e$\\*.zip \\\e$\\Archive\%date:~-4,4%%date:~-10,2%%date:~-7,2%%time:~-10,1%%time:~-8,2%%time:~-5,2%Prod.zip

移动/ Y \\\ e $ \\ *。zip \\\ e $ \\ Archive \%date:〜-4,4 %%日期:〜-1 0,2 %%日期: 约-7,2 %% e:〜-10,1 %% 时间:〜-8,2 %%时间:〜-5 ,2%产品 p

cd \documents\scripts

cd \ documents \ scripts

翻译自: https://www.experts-exchange.com/articles/12190/Deploying-C-Silverlight-5-Out-of-Browser-Apps.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值