Open mjauernig opened 6 months ago
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
:speech_balloon: 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
Would be nice if the build process generates the
appinstaller
file. With theapp_installer
configuration i get no file. The result should be like::question: Platform
Window