升级程序会在Windows Mobile 5中卸载它 [英] Upgrading a program uninstalls it in Windows Mobile 5

查看:105
本文介绍了升级程序会在Windows Mobile 5中卸载它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,这是我的问题。

OK so here's my problem. 

我有一个.NET程序直接部署为CAB文件到设备上(他们从网上下载并且没有访问权限)桌面使用任何其他类型的部署方法)。程序第一次使用空DB安装自己并设置一些注册表设置。运行该程序时,在相同的注册表项中进行更多注册表设置,并将数据添加到数据库中。

I have a .NET program deployed as a CAB file directly to the device (they download it from the web and do not have access to a desktop to use any other kind of deployment method).  The first time the program installs itself with an empty DB and sets a few registry settings.  When you run the program more registry settings are made in the same registry keys, and data is added to the DB. 

然后我做了一些程序更改并去部署它并发现了一个很大的问题。当该人去安装该程序时,它首先卸载删除旧数据库和注册表项的程序。所以所有的数据都丢失了!

I then made some program changes and went to deploy it and discovered a huge problem.  When the person went to install the program, it first uninstalls the program deleting the old DB and registry keys.  So all the data is lost!!! 

注意这个程序和升级方法在PPC2003中运行得非常出色,这就是为什么我认为5中没有问题。

Note this program and method of upgrading worked brilliantly in PPC2003 which is why I didn't think there would be a problem in 5. 

有关如何安装不删除旧版本的升级的任何建议?我甚至不介意它是否删除了注册表项中的所有注册表设置,即使安装时没有删除它们,因为我可以让程序将数据库移动到安装程序没有的位置。知道它作为第一个动作。

Any suggestions on how to install an upgrade that doesn't delete the old version?  I wouldn't even mind if it didn't delete ALL the registry settings in the registry keys even the ones that weren't there when it was installed, because i can have the program move the database to a loction that the installer doesn't know about as the first action that it takes. 

谢谢

Robert Brown

Robert Brown

推荐答案

嗨Robert,

Hi Robert,

默认情况下,如果您尝试重新安装同一个应用程序wceload。用于安装CAB文件的exe可执行文件将在安装新版本之前自动卸载以前版本的应用程序。作为此卸载过程的一部分,操作系统将删除在安装过程中创建的任何注册表项(即使其中存在未创建的密钥)。

By default if you attempt to re-install the same application the wceload.exe executable responisble for installing CAB files will automatically uninstall the previous version of the app before installing the new one. As part of this uninstall process the OS will remove any registry keys which were created as part of the installation process (even if there are keys present within them which it didn't create).

一个解决方案(带有它自身的副作用和问题)是修改CAB文件的ProductName字段。如果使用智能设备CAB安装项目,只需在解决方案资源管理器中选择安装项目,然后切换到"属性"选项卡。你应该看到一个"ProductName"你可以改变的财产。另一种可能更好的方法(如果它适合您的预期解决方案)是更改"NoUninstall";物业在同一个地方找到真实。如果设置为true,则应用程序不会出现在"删除程序"中。列表,因此当您尝试使用newever版本覆盖它时,将不会检测到它已安装。

One solution (with it's own side effects and problems) is to modify the ProductName field of your CAB file. If using a Smart Device CAB Setup project, just select the setup project within Solution Explorer and switch to the Properties tab. You should see a "ProductName" property which you can change. Another perhaps better approach (if it suits your intended solution) is to change the "NoUninstall" property found in the same place to true. If set to true the application will not appear in the "Remove Programs" list, and hence won't be detected as being installed when you attempt to overwrite it with a newever version.

隐藏在智能手机下面device cab项目类型正在构建一个INF文件,它将传递给命令行工具来构建您的CAB文件。从INF文件格式的内存中,有一个标志可以提供给各个注册表项,以指定它不应该在卸载时删除它们。但是我不知道通过GUI设置此标志的方法,我通过Visual Studio IDE将此标志置于不受支持的内容领域(例如,IDE不支持的CAB文件中可用的另一个标志是单个文件上的标志,用于指示设备上已存在该文件时的预期行为等。)

Underneath the covers the smart device cab project type is building up an INF file which it is passing to a command line tool to build your CAB file. From memory within the INF file format there is a flag which can be given to individual registry keys to specify that it shouldn't delete them on uninstall. However I am not aware of a way for this flag to be set via the GUI, I bieleve this flag falls into the realm of unsupported stuff via the Visual Studio IDE (for instance another flag available within a CAB file not supported by the IDE is a flag on an individual file to indicate the intended behaviour if the file already exists on the device etc).

您可以获取INF文件(在构建设置时在CAB文件旁边找到)项目)并使用MSDN上的详细信息来修改它以添加这些额外的标志。但是,如果您这样做,则无法通过Visaul工作室GUI进行进一步更改。

You could take the INF file (found beside your CAB file when you build the setup project) and use details on MSDN to modify it to add these additional flags. However if you do this you can't make further changes via the Visaul studio GUI.

希望这会有所帮助,

Christopher Fairbairn

Christopher Fairbairn


这篇关于升级程序会在Windows Mobile 5中卸载它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆