In this tutorial we are going to see how to avoid our application to be installed in SD card directly by the consumers. There are possible cases the app can be installed on to the SD card directly as the latest devices (Lumia) has support to install the application to SD Card and can also install in the local storage. As a developer I prefer having my apps installed to the application storage rather the SD card as it has more control over the app loading, if by any chance the SD is changed or corrupted from consumer perspective if the app is not loading its going to be a bad debt for the app to the future by the reviews.
To do this, we don’t need to really programmatically control by writing couple of lines of code rather its the setting which prevents the Consumer or the User to install the application to the SD card by prompting and telling this is not possible and its restricted. So what steps we need to do?
Step 1 – Open the application in Visual Studio and make sure the application and building and executing perfectly.
Step 2 – Go to Solution Explorer and double click the Manifest file (WMAppManifest.xml) file and you can see the app settings and capabilities page as shown in the screen below.
Step 3 – Now in the manifest file navigate to Packaging Tab and you can see a checkbox with option Prevent deployment to SD Cards. If you want to prevent installing to SD card, click on that option and if you don’t want you can remove that option and upload the package again to the store. As per the selection it will avoid deploying or installing the application to the device.
The app can now be published to the Market place and when the consumer prompts to install the application to the SD card storage, it will prompt and update the user with the information that the app developer has restricted and it will not install the app to the SD card and request the user to change the settings and allow the app installation to done in the local storage.