Skip to content

Windows UWP integration (Code snippet attached) #9

@SunshineSpring666

Description

@SunshineSpring666

Hi Jimmy,
UWP support of specifying path to download and installing the app package can be done by the following platform specific code.
I tried to integrate this into your source code to support Windows platform, but haven't figured it out.
Is it possible for you to integrate this code into this wonderful AppInstallHelper?

//---------UWP code (Tested)
using Applicat.Common;
using Applicat.UWP;
using System;
using System.IO;
using System.Threading.Tasks;

[assembly: Xamarin.Forms.Dependency(typeof(Update))]
namespace Applicat.UWP
{
public class Update : IUpdate
{
public string SpecifyFilePath(string fileName)
{
return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), fileName);
}

    public async Task<bool> Install(string stringUri)
    {
        try
        {
            return await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-appinstaller:?source=" + stringUri));
        }
        catch (Exception ex)
        {
            return false;
        }
    }
}

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions