Install xap file on windows phone from inside an application - windows-phone-8

I try to install a windows phone application from inside an application using this code
Uri FILE_URI = new Uri("ms-appdata:///local/myapp.xap",UriKind.Absolute);
await InstallationManager.AddPackageAsync("my app", FILE_URI);
but it return
global::System.Diagnostics.Debugger.Break();
i try to use
Uri FILE_URI = new Uri("ms-appdata:///local/myapp.xap",UriKind.Absolute);
var file = await StorageFile.GetFileFromApplicationUriAsync(FILE_URI);
await Launcher.LaunchFileAsync(file);
but the windows phone error happened
Can't install company app
there's a problem with this company app.
Contact your company's support person for help.
how can I install xap file from inside application? thanks.

Little information ...
There are several causes of the problem:
1) your xap file is downloaded contains the signature Windows store? I.e. you published your app Store and downloaded the install file for?
2) You trying are enterprise application scenario with self-signed XAP file?
3) As i'm understand it, the method is intended for AddPackageAsync. InstallationManager installing applications from external sources as "http//...". I'm not sure what method the XAP has installed from a local storage.
4) Installing the application that is downloaded from the Windows store are available from the SD card. I think that there are restrictions on the installation of the XAP file from local storage.
5) Known problem when InstallationManager. AddPackageAsync does not work on the emulator, but works on the device. Error code '0x800703F0' for Signed internal App while using InstallationManager

Related

Can I generate an appx with a windows phone project?

My question is based on this:
I have a xamarin forms project, (which has 3 projects: iOS, Android and Windows phone). Using the build options Release ARM we have successfully generated an .xap file to upload it to the windows phone store.
My question is: Using the same project can we generate a appx file to upload it to the windows store or do we have to create a Windows Store app?
As far as I know this is not possible since I have "Create App packages" disabled:
Thanks in advance.
When you have completed 'Store - Create App Package..' (answer: 'No' when it asks about Store deployment), APPX file appears in Debug/Release (NOT Package output) folder. If menu disabled - try to reload project/solution or restart VS.

Windows Phone 8 Error - Installation of the application failed

I am working on a Windows Phone 8 project where we are deploying it as a company app through HockeyApp. I have a .PFX file generated from our Symantec cert and the correct .aetx file installed on the device.
If I take the .XAP file I intend to deploy and copy it somewhere separate and test it by deploying it using the XapDeploy.exe tool, it will install silently and work properly. Then I use the XapSignTool to sign the .XAP against the .PFX successfully ("XapSignTool Success: Successfully signed = C:\xxx").
When I attempt to test this recently signed XAP with the XapDeploy tool I will get the error "Error - Installation of the application failed. Run time error has occurred. Fix the Capabilities in the WMAppManifest.xml file." If deploy this file with HockeyApp the install will silently fail on the device and appear to just sit there after download.
Does anybody know what could be causing this after code signing?
I was able to resolve my issue. First, a codesigned XAP will not run in the emulator unless you have already installed the AET file on that current running version of the emulator. So, it was incorrect for me to to expect not to see a failure after the XAP was signed.
I then encountered some other issues when deploying to my device. This was resolved by making sure that the Publisher ID GUID was the same as the Publisher ID used for the Symantec cert.
Also, as opposed to using the XapSigningTool directly I ended up using the PowerShell script that runs both the MDILXAPCompile and signs the XAP in a single step (making the post-build step easy to write). The ps script BuildMDILXap.ps1 is found under \Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Tools\MDILXAPCompile\ and ships with the SDK apparently.

Which Xap file is to be submitted to windows phone store

I have developed an application using Nokia Imaging SDK. It builds two forms of the XAP file, one for ARM platform and another for x86. Can anyone tell me which XAP file should be submitted to windows phone 8 store ??
And should I submit the file from debug folder or from release folder and why ??
Thank you!!
Can anyone tell me which XAP file should be submitted to windows phone
8 store ??
Use Any CPU, this will allow them to test it on emulators (x86) or real devices (ARM).
And should I submit the file from debug folder or from release folder
and why ??
Release, because this mode includes optimizations not present on Debug mode.
You have to submit the one in the Release folder:
In the Upload XAP dialog, be sure that you select the release build of your XAP
From: Upload and describe your XAP(s)
You need to set target platform as ARM while creating XAP in release mode because mobile phone have ARM processors so they will need XAP build on ARM configuration. x86 is for emulators only.
The XAP in the ARM Release ie- <Project Folder>..\Bin\ARM\Release\ should be submitted to the Windows Store.
Windows Phone Devices uses ARM based processors.
To generate the output-
First Select Release from the Solution Configuration DropBox.
Then go to configuration manager and change the AnyCPU field to
ARM.
Then Build the project.

XAP file is invalid

My phone is developer unlocked and I have installed windowsphone 8 SDK on my pc. When I try deploy any xap file from store and other source as well to my phone (device) it throws an error "XAP file is invalid"
Make sure the package is built using Release and not Debug.
You can refer the following links for more information-
http://slvideoplayer.codeplex.com/wikipage?title=installation%20instructions&referringTitle=Home
and
http://www.geekchamp.com/articles/deploying-wp7-xap-files-to-a-device-or-emulator

Add xap file in sd card on windows phone

I created a sample app in windows phone 8,now i want to add my xap file into windows phone device,for that i copied xap file into sd card,but in windows device,there is no file exists in sdcard in store tile,
Any suggestions?
you cannot install a xap file into phone like this.
there are two ways to install an app one is by downloading it from app store and other one is by installing app from visual studio on a developer unlocked device.