Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows UWP integration (Code snippet attached) #9

Open
SunshineSpring666 opened this issue Jul 20, 2022 · 2 comments
Open

Windows UWP integration (Code snippet attached) #9

SunshineSpring666 opened this issue Jul 20, 2022 · 2 comments

Comments

@SunshineSpring666
Copy link

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;
        }
    }
}

}

@JimmyPun610
Copy link
Owner

Hi,

I have no planning to implement to UWP...
But I am happy if you could create a pull request to improve the code

@SunshineSpring666
Copy link
Author

OK, Jimmy, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants