Windows 8 App updates - windows-8

I want to publish an update for an app that is already in the Windows Store. When I create the new version, is it necessary to delete the old package, or the new one must be addeed to the list?

You can only have one release of an app in the store at any one time. Which means that once a new release in certified, it effectively overwrites the old one. That doesn't necessarily relate directly to the packages, as you can create a new release with the same packages if you so wish (you do have to change something though, otherwise it won't let you resubmit).

Related

wix installer - supporting upgrade and more than one installation at the same time

I know that you can upgrade the versions, remove the old the installation and install the new version.
and I know you can also support two installations of the same software on the same machine.
Is there a way to create a GUI installation which let's the user choose if he wants to upgrade or keep the old version and install the new instance in addition to old the ones?
Yes, but it's not simple.
Basically you start with two upgrade table entries. One that is fake and would never detect a product and one that detects your previous versions but has the DetectOnly attribute set.
Next you need to create a custom dialog with a radio button ( install new, upgrade existing ) and a list box to contain the entries of previously detected products. You will use a custom action to populate the ListBox table with temporary rows to reflect the previous qualifying products to be upgraded.
If the user selects Install new, you just carry on. If they select upgrade existing you parse out the product codes from the Detect Only upgrade action property and put them into the "fake" action property. Now remove existing products will have something to remove.
They are all kinds of business rules you'll want to come up with and enforce, cover the silent installation story and also have a way of mutating the INSTALLDIR so the products can be side by side.
That's the basic pattern but you'll have to come up with all the details around it. I've done this several times with very favorable results.

Windows CE6.0 change registry requires two restarts when updating NK.bin file

When I update my system with a new NK.bin file, I want to keep same language configuration I had before.
A suggestion was made that I read the information from the registry, then copy my new NK.bin file, replacing the current NK.bin (yes, you can do this while windows is running using that NK.bin file).
When this is done I write the values back to the registry.
My understanding is that this will affect the NK.bin after restart. This mean that the system shouldn't notice here that it is a new NK.bin file during restart.
And it works fine, the registry changes its value. HOWEVER, when I'm doing the update, it ends with a restart of the system.
When I login after that restart, the regsitry is changed to correct/loaded value, but it shows wrong language. Then after another restart the language is correct.
I want to handle this directly, making the system start with correct language from the start.
The code below shows last step of my update before restart. The new NK.bin file is just copyied and replaced the old one.
Should also say that following register is changed but wont take effect until the second restart:
cSysLang = #"MUI";
cDefaultLCID = #"nls";
cTouchCalibrationData = #"HARDWARE\DEVICEMAP\TOUCH";
cKeyboardDefaultSubKeyStr = #"keyboard layout\Preload";
cLangSubKeyStrCurrUsr = #"MUI";
cLangSubKeyStr = #"nls\overrides";
private void LoadDataAfterInstallation()
{
//langauge
Microsoft.Win32.RegistryKey regLanguage = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(cLangSubKeyStrCurrUsr, true);
if (!(languageRegInfo==0))
regLanguage.SetValue("CurLang", languageRegInfo);
First let's discuss how a persistent registry works. I'm going to assume this is a newer device and it's using a hive-based registry (there was an older mechanism for persistence that worked in a completely different manner, but I've not seen much of it since the 4.x days).
The device has a baseline registry hive that the OS loads up when it's first booted (system.hv). It then applies your changes (user.hv) to that baseline registry. Now before either of these is loaded, the OS should be doing a checksum of the NK.BIN, and if it's different, it should toss out both and recreate them. A registry from an old OS is not guaranteed to be valid for a new OS, and for sanity's sake they should never be used.
So the order should be something like this:
Read registry
Update NK.BIN
Restart
OS deletes the old registry
OS loads the default language in the default registry
Write your registry values for the new language
Restart
OS loads new registry changes
OS loads new language
This, I think is where you are, yes?
The second restart is necessary for the OS to be able to see the registry changes you made. You may be able to avoid the second restart (I'm not sure - it's been years since I tested this and don't recall) by broadcasting a WM_SETTINGS_CHANGE after restoring the value. As a definitive resource, look at the Control Panel source code to see what it's doing when the user changes the OS language with the UI.
If you are using MUI I think you can't avoid the restart. Some settings may be refreshed dinamically, but language isn't. But you can programmatically restart your device as soon as you re-imported the registry. Isn't that an option? You can include a key in the reg inside the image and change it when boot is completed. If you have the image value it means that the registry need to be restored. You restore it, setting the new value, and then automatically restart the machine. This should be a minor inconvenience for your users.

Metro (XAML/C#): detect installation and/or first run

When creating Metro applications in XAML/C#, how do I detect when the application is first installed or run for the first time since installation (or potentially upgrade)? I need to use this opportunity to ensure that my database schema is correct and potentially synchronise some base data.
I had hoped that I could pick this up from the LaunchActivatedEventArgs within the OnLaunched method, but there does not seem to be a valid value for the Kind or PreviousExecutionState that I can use.
Thanks.
http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.applicationdata.localsettings.aspx#Y0
When your app starts, write a setting called "AppHasBeenStarted" or something to LocalSettings. If the setting has not already been written, you know your app hasn't been started before. And you could improve on this, by making it "AppVersion", and writing the app's version. This way your app can detect upgrades by comparing the stored version with its own version.

Updating an iPad App with a Completely Different Architecture

I've been updating my iPad app very steadily now and the process has been fine. But in a month or so, I'm going to be upgrading it to a version that has a completely different architecture.
Both versions will be using the cache and db in very different ways to store the data it's pulling from a server.
Question: Will the Apple update process automatically delete all local data from my previous version upon installing the new version? Or, do I have to code this functionality in somewhere in my new version?
Example: Some files you download on Windows don't remove the data from "Application Data" or "Local Settings" upon uninstalling. I fear that this same scenario will happen on my iPad when upgrading my app to a completely new version. Is this the case?
Thanks,
Derek
No, the update process does not delete files that you have in the app's documents folder. They will still be there.
iPhone and iPad updates do not remove data from previous version installations of an app. Your app will have to detect (say, look for the current version number) the old databases, and either delete them, or perhaps better for the user, update them to the new format.
Make sure to somehow tag the new data format with a version number so your app can detect it, and not delete it.

Testing on blackberry device - adding and removing app multiple times

It would be useful for many people to know how to completely remove an application from your device when testing.
I have downloaded my app many times now, and likewise have deleted it many times. The problem is when deleting the app, it does not remove things like the persistent object related to my app, or the images downloaded through the app. So, when I download the next build, I have no idea if something broke that is related to building the persistent object or fetching the images since those elements already exist from the last build.
I don't know if this is a cache thing. I don't know if this is expected and I have to use some utility to wipe this data after deleting the app. I can't really find much info through basic web searches.
Any information would be appreciated.
Blackberry Bold 9000. 4.6 OS. tested with both SD card and no SD card.
Objects stored in the PersistentStore are automatically deleted on uninstall if their interfaces were defined in your project. If they are from the standard BlackBerry API then they will stick around until they're deleted. E.G if you save a String in the PersistentStore it will stay in the PersistentStore but if you save a class you created it will be deleted on an uninstall. So if you want to have those objects be deleted automatically just create a wrapper class and save that.
Images stored on the filesystem will not be deleted until you or some application deletes them. However, it should be easy for you to write an app that clears everything out.
Another solution you could implement is making your app somewhat self-aware of its data.
Create a simple String value that you persist (or optionally, persist it in a Hashtable so you can store many properties this way) that includes "Version".
At startup of the GUI app, compare the stored "Version" against the application's current version. If the stored version doesn't exist, or if it exists and matches, take no action.
If it exists and does not match, automatically clean up old persisted data; or alternatively prompt the user to see if they want that data to be deleted (which one is better will depend on your implementation)
You can also use CodeModuleListener to listen for an uninstall event -- when that happens, you can clean up at that time as well or instead.
(As an aside and a bit of shameless self promotion, I am actually currently working on a shareable library for Blackberry that makes managing persistence much easier, as well as desktop data backup/restore. I'm doing this as part of the BBSSH project, but I'll be splitting it off into a separate library of core components and publishing it under a dual GPL/optional commercial license. It will contain hooks for data cleanup and data versioning. )