[windows] Add MSIX app support
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)
+1
我参考这个文章解决了。 https://www.advancedinstaller.com/msix-disable-registry-file-redirection.html
如果你们也是用msix这个包。
打开appx_manifest.dart在<Properties>添加一行<desktop6:RegistryWriteVirtualization>disabled</desktop6:RegistryWriteVirtualization>
然后pubspec.yaml的msix_config:加上capabilities: unvirtualizedResources
打包出来的应用应该能穿透注册表隔离。
unvirtualizedResources慎用,审核好难过😅
Supported on https://github.com/leanflutter/launch_at_startup/commit/0e03e15e8b9896bb9c5491565da3297588951a85