How do you test Windows Phone 7 app upgrades? - windows-phone-7

Version 1.5 of my Windows Phone app uses Version 1 of a 3rd party Isolated Storage library. I Version 2 of this library has performance improvements and bug fixes. I would like to upgrade my app (make it Version 1.6) to the new version but would like to test that data is not lost during upgrade.
I deployed version 1.5 to the phone and when I deploy version 1.6 from VS2010, the previous app and data are lost. My app is not upgraded but simply replaced.
How to I test the upgrade?
Thanks

You should deploy from within Visual Studio after rebuilding the xap, not using the xapdeploy tool - see this article for an example:http://gusperez.com/wp/2010/12/22/update-testing-your-windows-phone-7-apps/

I'm guessing that you have 2 separate project which each have the same ProductID (in WMAppManifest.xml). This would explain why the first app is being uninstalled when the second app is deployed.
I'd test this by manually setting the contents of Isolated on the first run of the new version of the app.
There are 2 approaches you can take:
- Manually set the contents of the files in IS (either in code or during debug)
- Use a tool like Isolated Storage Explorer

I would probably do something like:
You can use Isolated Storage Explorer Tool (ISETool) to copy the isolated storage files from your old version into a directory (which you would commit to source control).
Create a Build Configuration called "Debug - Upgrade from 1.5"
Define a Post-Build Event that copies the data from the 1.5 backup directory to the emulator (it will need to be running; you may want to create a separate command line that starts the emulator)
Now you should be able to just hit F5 (after the emulator is already running) to test your upgrade over and over.
(Ideally, if Visual Studio used MSBuild to do the Deployments to the emulator/phone, we could simply hook into that process and update the IS after deployment but before execution. Sadly, that is not the case)

Related

How Do I configure my setup in Visual Studio 2010 using Visual Studio installer to check for updates?

I have built an Application using visual studio 2010 and a setup using the Visual Studio installer. Now what I want is whenever the exe is installed on a client machine it should check for updates regularly.
Any Suggestions . Please Help.
It's my experience that most people do this in the app itself, so that when it runs it checks your web site for updates.
Basically you need a web service call to which your app passes the ProductCode and Version of your setup, your MSI file build. At your web host you need a database (or Xml file) that has information on the latest available version and it's download location so that you can return that information to your app, assuming the latest version is higher than the running one.
You're in Visual Studio, so you build a RemovePreviousVersions updated MSI, and that's what you download and install. If the install needs admin rights and your app isn't elevated than you'd launch an external exe with an elevation manifest to get it installed.
I just finished a project similar to this, but instead of using Visual Studio installer libraries, I created a windows service that runs on a 10 minute loop, and when the service detects a new version, it kills the running application and performs a download and copies the new files into the application folder.
There are a few things you need to take into consideration; 1) A way to gracefully warn and then close the application so the user is not angry over a forced kill of the application. 2) A web location to store the upgraded application files, and a web service to advertise the available application versions. 3) A way to queue the upgrades so that when a new version is released not every client will be upgraded at once (flooding your web server with upgrade requests and downloads).
This technique is used by Adobe for upgrading and installing applications such as Acrobat Reader and Flash.

How do I make Visual Studio update a Windows Store App, not replace it

I have a Visual Studio project for a Windows Store app written in C#. I want to test the app in a situation where a user updates from one version to another, but I can't. When I try to debug my app in Visual Studio, I get this message:
The app xxx is already installed on this machine.
If you continue with the current deployment, the existing app will be uninstalled and the app's current state will be deleted.
I don't want to lose the existing state of the app because I wrote code to find the old version of some data and to update it.
Installing the previous version from the Windows Store, or from a side-load, both have the same effect. I can't then test the new version in Visual Studio.
Does anyone know a way to get Visual Studio to not delete the old version, and install the new version from scratch?
You should not use the version from the Store. Simply deployy the app from Visual Studio (via debug).
To test
Set the version number to a previous number
Deploy the app
Use the app
Change app version number
Deploy the app
Use the app
Step 6 is where you will notice the app has been updated.
I know it's a little late but there is another way to do this.
install the old version
use the app to generate the data you want to test
Copy the LocalState directory from C:\users\USERNAME\AppData\Local\Packages\APPNAME
Do not close the app
run the new app from Visual Studio
Say yes to the prompt about removing the old app and data
Kill the app at the first screen
Copy the old LocalState dir back into the Packages dir
Run the app from VisualStudio

Windows CE 6.0 - Installing SQL Server CE 3.5 into the run-time image

I made an application that I put onto the hard disk of Win CE (the Compact Flash card). My problem is that the application is using the SQL Server CE 3.5 database but it looks like that the image is created with the SQL Server CE 3.0. I couldn't select the 3.5 version when I started to build the image.
The 3.5 version dlls are deployed every time I debug the application so the problem never shows up in the development phase.
Now when the application starts (it is started automatically when OS boots) the message window with exceptions pops up and don't let the application to start. My question is how to install the SQL Server CE 3.5 into the image or how to install it using CAB files later or on every boot up time.
When I run the correct CAB files (three CAB) on running OS system it installs the 3.5 version and my application starts but when I reboot the OS again the changes are not saved and commit. There must be a solution to add the 3.5 version in the catalog before building the image or to install it on every boot up time or the last option to install it permanently once after the first boot.
If you can provide me the solution to install the CABs every time the system boots up It will work for me but then take into the consideration that I have to run the application that will use the SQL Server CE 3.5 database on system start so the installation of the CABs must precede the application autostart.
Thanks in advance.
You have a few options. The least desirable is to run the CAB at startup.
One option is to put the newest SQLCE binaries into the OS if you can. This is available in the catalog, provided you have all of the updated QFEs installed. If, for whatever reason, you can't install the QFEs, you could always replace the source binaries Platfrom Builder pulls from at %WINCEROOT%\OTHERS\SQLCOMPACT.
Another option is to just include all of the SQLCE binaries in your application deployment. You don't need a CAB, just put the DLLs in your app folder (removing SQLCE from the OS is a good idea if you go this route to prevent native DLL collision). The source for these binaries is at %PROGRAM_FILES%\Microsoft SQL Server Compact Edition\v3.5\Devices. This is actually the route I prefer, as an update to SQLCE doesn't require a new OS.

VS 2010 Major Publish Version Change - New Application or Overwrite Previous Version

Using Visual Studio 2010 Professional Windows Form App. Currently a ClickOnce application has only been incrementing the Revision value (1.0.0.15). Settings are to Automatically increment revision with each publish. Client app updates automatically before application opens.
If I manually increment the Major value (2.0.0.0), is this going to install another version of the application or just overwrite/update the existing version on a client's machine? I recall using the express version and this happened.
If you are using the minimum version in the Updates dialog, or your application is online only, ClickOnce only keeps one version on the client machine.
If you are not pushing the update as required (minimum version is filled in), and your application is online/offline, ClickOnce keeps two versions on the client machine. This means that the user can go to Add/RemovePrograms and back out the most recent version if needed.
ClickOnce installs whatever version number is in the deployment manifest (.application file) in the root folder of the deployment folders. If you change your version to 2.0 and deploy it, it will install 2.0. If you then decide you don't like it and want to go back, you can pull an earlier version of the .application file out of one of the Application Files folders and copy it to the root folder, and the next time the user runs the application, it will install that version. This doesn't work if you are pushing updates as required (min version).
If you want to run multiple versions of the same application on the same machine, you have to change the assembly name, the product name, the publishing folder location, and the installation URL.
Incrementing any part of the version number will not install another version of the application. It will simply update the existing installation.

Why does Windows application is requiring .Net 3.5 framework

I have the Target Framework set to 2.0 on my windows application, yet when I try to install my app on the server, after publishing it through VS 2008, it is trying to install .Net 3.5 on the server.
I do not want to install 3.5 on my server.
When I copy the files from my local /bin/debug/ to the server and double click on the exe, nothing happens. On my local machine, my app runs.
How can I make this app run on the server without it needing the .Net 3.5 framework?
Do any of your dependencies require .NET 3.5? Do you have anything in any config files which might require .NET 3.5?
I suggest you take a copy of what you've got for safekeeping, and then cut it down to the very smallest app which demonstrates the problem. In fact, you might want to start from scratch with a "no-op" app and see whether that has the same behaviour.
Check unused references, perhaps? Are you actually getting an error about the 3.5 framework?
Try building the application in release mode and deploy it to the server. You will need to grab the application from the /bin/release folder instead of the /bin/debug folder.
Also, check the target framework under the application section of the project properties.
If you're using Visual Studio to build your setup project, open the setup project's properties and look through the settings. One setting says which .Net version will be demanded by the installer package. You have to set that; it doesn't inherit from known properties of your other projects.

Resources