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

[FEATURE REQUEST] Reenable appinstaller for web #256

Open
mjauernig opened this issue Jan 5, 2024 · 2 comments
Open

[FEATURE REQUEST] Reenable appinstaller for web #256

mjauernig opened this issue Jan 5, 2024 · 2 comments

Comments

@mjauernig
Copy link

💬 Description

I use successfull appinstaller on Windows 11 and Server 2022 (with a modified proceed from here)

I also installed another apps via appinstaller. Example MSIX Hero

On this blog their is also the following update

Update: August 5, 2022 – The fix to enable the ms-appinstaller protocol handler was rolled out to Windows 11 Insider Preview Build 25147 for the Dev Channel. We will provide updates on the availability of the fix when we have them.

Would be nice if the build process generates the appinstaller file. With the app_installer configuration i get no file. The result should be like:

<?xml version="1.0" encoding="utf-8"?>
<AppInstaller
    Uri="https://.../ypsi.appinstaller"
    Version="1.0.9.0" xmlns="http://schemas.microsoft.com/appx/appinstaller/2018">
    <MainPackage
        Name="..."
        Publisher="CN=... cert subject"
        Version="1.0.9.0"
        Uri="https://.../ypsi.msix"
        ProcessorArchitecture="x64" />
    <UpdateSettings>
        <OnLaunch
            HoursBetweenUpdateChecks="0"
            ShowPrompt="true"
            UpdateBlocksActivation="true" />
        <AutomaticBackgroundTask />
        <ForceUpdateFromAnyVersion>true</ForceUpdateFromAnyVersion>
    </UpdateSettings>
</AppInstaller>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

❓ Platform

Window

@aweinber
Copy link

aweinber commented Jan 18, 2024

I think dart run msix:publish creates an app_installer file, but I don't think it supports arbitrary URIs - the file has a local URI (its path on the local machine), and the following sections would need to change to support arbitrary web endpoints.

configuration.dart

    dynamic installerYaml = yaml['app_installer'] ?? YamlMap();

    publishFolderPath =
        _args['publish-folder-path'] ?? installerYaml['publish_folder_path'];
    hoursBetweenUpdateChecks = int.parse(_args['hours-between-update-checks'] ??
        installerYaml['hours_between_update_checks']?.toString() ??
        '0');
    if (hoursBetweenUpdateChecks < 0) hoursBetweenUpdateChecks = 0;
    automaticBackgroundTask = _args.wasParsed('automatic-background-task') ||
        installerYaml['automatic_background_task']?.toString().toLowerCase() ==
            'true';
    updateBlocksActivation = _args.wasParsed('update-blocks-activation') ||
        installerYaml['update_blocks_activation']?.toString().toLowerCase() ==
            'true';
    showPrompt = _args.wasParsed('show-prompt') ||
        installerYaml['show_prompt']?.toString().toLowerCase() == 'true';
    forceUpdateFromAnyVersion =
        _args.wasParsed('force-update-from-any-version') ||
            installerYaml['force_update_from_any_version']
                    ?.toString()
                    .toLowerCase() ==
                'true';

app_installer.dart

  Future<void> generateAppInstaller() async {
    _logger.trace('generate app installer');

    String appInstallerContent = '''<?xml version="1.0" encoding="utf-8"?>
  <AppInstaller xmlns="http://schemas.microsoft.com/appx/appinstaller/2018"
    Uri="${_config.appInstallerPath}" Version="${_config.msixVersion}">
    <MainPackage Name="${_config.identityName}" Version="${_config.msixVersion}"
      Publisher="${const HtmlEscape().convert(_config.publisher!.replaceAll(' = ', '='))}"
      Uri="$_msixVersionPath"
      ProcessorArchitecture="${_config.architecture}" />
    <UpdateSettings>
      <OnLaunch HoursBetweenUpdateChecks="${_config.hoursBetweenUpdateChecks}" 
        UpdateBlocksActivation="${_config.updateBlocksActivation}" ShowPrompt="${_config.showPrompt}" />
        ${_config.automaticBackgroundTask ? '<AutomaticBackgroundTask />' : ''}
        ${_config.forceUpdateFromAnyVersion ? '<ForceUpdateFromAnyVersion>true</ForceUpdateFromAnyVersion>' : ''}
    </UpdateSettings>
  </AppInstaller>''';

@YehudaKremer is my understanding correct? I need this use case myself and would draft a PR to support arbitrary URI overrides if you think this is a reasonable approach. Thanks in advance - this package has been a lifesaver already

@alexh67
Copy link

alexh67 commented Sep 11, 2024

Hi,

Any updates to this topic ? Is appinstaller supported with remote urls ?

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

3 participants