leanflutter/launch_at_startup

[windows] Add MSIX app support

Closed this issue · 6 comments

The issue is when I enable launch at startup for my app which is installed using MSIX, literally nothing happens.
I found a workaround, which is running a batch / ps script to remove / add app shortcut to startup apps:

@echo off
SET currentDirectory=%~dp0
PUSHD %currentDirectory%
CD ..
CD ..
CD ..
CD ..
SET MNIST_DIR=%CD%
SET appExeDir=%MNIST_DIR%
powershell "$s=(New-Object -COM WScript.Shell).CreateShortcut('%userprofile%\Start Menu\Programs\Startup\WTNews.lnk');$s.TargetPath='%appExeDir%\wtnews.exe';$s.Arguments='connect';$s.IconLocation='%userprofile%\Start Menu\Programs\WTNews.lnk';$s.WorkingDirectory='%appExeDir%';$s.WindowStyle=7;$s.Save()"

This works without a flaw, and isEnabled and isDisabled booleans can return existence of the shortcut.

+1 (Same)

+1 (same)

shuax commented

+1

shuax commented

我参考这个文章解决了。 https://www.advancedinstaller.com/msix-disable-registry-file-redirection.html

如果你们也是用msix这个包。
打开appx_manifest.dart<Properties>添加一行<desktop6:RegistryWriteVirtualization>disabled</desktop6:RegistryWriteVirtualization>
然后pubspec.yamlmsix_config:加上capabilities: unvirtualizedResources
打包出来的应用应该能穿透注册表隔离。

shuax commented

unvirtualizedResources慎用,审核好难过😅

Supported on 0e03e15