티스토리 뷰

반응형

Register Desktop Bridge app and UWP app as Startup program

Future Of DotNet
https://youtube.com/FutureOfDotNet

UWP앱을 시작프로그램으로 등록/삭제하는 방법입니다.

Youtube : https://youtu.be/5cI6oS0HLOQ
Blog : https://kaki104.tistory.com/664
Git : https://github.com/kaki104/StartupSample

Reference

Desktop Bridge vs UWP

  • How
  • Namespace
  • EntryPoint
  • Enabled
  • Multiple startupTask
  • Diabled/Enabled

Constrained in UWP apps

  • The default is Disable
  • Show a user-prompt dialog for UWP apps
  • StartupTask includes a Disable method
  • If the user disables, then the prompt is not shown again
  • If the feature is disabled by local admin or group policy, then the user prompt is not shown, and startup cannot be enabled
  • Platforms other than Desktop that don’t support startup tasks also report DisabledByPolicy

Package.appxmanifest

<Application>
    <Extensions>
        <uap5:Extension Category="windows.startupTask“ Executable="StartupXXX.exe“ EntryPoint="StartupXXX.App">
            <uap5:StartupTask TaskId="StartupXXX“ Enabled="false“ DisplayName="StartupXXX“/>
        </uap5:Extension>
    </Extensions>
</Application>

MainPage.xaml.cs

var startupTask = await StartupTask.GetAsync("StartupXXX");
StartupTaskState newState = await startupTask.RequestEnableAsync();

App.xaml.cs

protected override void OnActivated(IActivatedEventArgs args)

var staea = args as StartupTaskActivatedEventArgs;
rootFrame.Navigate(typeof(MainPage), staea.TaskId);
Window.Current.Activate();

Register startup program.pdf
190.9 kB

반응형
댓글