launch_at_startup icon indicating copy to clipboard operation
launch_at_startup copied to clipboard

[windows] Add MSIX app support

Open Vonarian opened this issue 3 years ago • 5 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.

Vonarian avatar May 09 '22 10:05 Vonarian

+1 (Same)

tenraneko avatar Oct 16 '22 13:10 tenraneko

+1 (same)

ksm-android avatar Dec 15 '22 06:12 ksm-android

+1

shuax avatar Nov 15 '23 01:11 shuax

我参考这个文章解决了。 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 avatar Nov 15 '23 03:11 shuax

unvirtualizedResources慎用,审核好难过😅

shuax avatar Nov 17 '23 01:11 shuax

Supported on https://github.com/leanflutter/launch_at_startup/commit/0e03e15e8b9896bb9c5491565da3297588951a85

lijy91 avatar May 18 '24 06:05 lijy91