Question

Is there any way to open .onepkg file in Windows Phone 8 using C# code?

I tried using

string imageFile = @"File.onepkg";
var file = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(imageFile);
var success = await Windows.System.Launcher.LaunchFileAsync(file);

This is a default launcher for launching apps in the phone.

I have OneNote installed (It works perfectly fine and opens OneNote in windows phone emulator when i change the extension from .onepkg to .one).

But if it is a OneNote notebook, instead of opening OneNote it looks in windows phone store and when I say "I accept", it shows "No apps found".

Can anyone please give me any pointers/suggestions?

Was it helpful?

Solution

Based on the <Extensions> element of the WP8 Onenote app it seems only *.one and *.onetoc2 file extensions are supported in the current version. That makes sense connsidering *.onepkg files are templates to create new files but app2app file extension support is currently limited to read-only scenarios.

  <Extensions>
    <FileTypeAssociation
      Name="OneNote file"
      TaskID="Default"
      NavUriFragment="CmdLine=-s &quot;token:%s&quot;">
      <Logos>
        <Logo Size="small" IsRelative="true">OneNoteFileIcon.small.{ScreenResolution}.png</Logo>
        <Logo Size="medium" IsRelative="true">OneNoteFileIcon.medium.{ScreenResolution}.png</Logo>
        <Logo Size="large" IsRelative="true">OneNoteFileIcon.large.{ScreenResolution}.png</Logo>
      </Logos>
      <SupportedFileTypes>
        <FileType ContentType="application/onenote">.one</FileType>
      </SupportedFileTypes>
    </FileTypeAssociation>
    <FileTypeAssociation
      Name="OneNote notebook"
      TaskID="Default"
      NavUriFragment="CmdLine=-s &quot;token:%s&quot;">
      <Logos>
        <Logo Size="small" IsRelative="true">OneNoteNoteBookIcon.small.{ScreenResolution}.png</Logo>
        <Logo Size="medium" IsRelative="true">OneNoteNoteBookIcon.medium.{ScreenResolution}.png</Logo>
        <Logo Size="large" IsRelative="true">OneNoteNoteBookIcon.large.{ScreenResolution}.png</Logo>
      </Logos>
      <SupportedFileTypes>
        <FileType ContentType="application/onenote">.onetoc2</FileType>
      </SupportedFileTypes>
    </FileTypeAssociation>
    <Protocol
      Name="onenote"
      TaskID="Default"
      NavUriFragment="CmdLine=-u &quot;%s&quot;"/>
  </Extensions> 

OTHER TIPS

I think onepkg is a zip file containing .one and .onetoc files along with directory structure. So one way could be to expand this cab file and then open it.

Type: Cab

Method: LZX

Blocks: 1

Volumes: 1

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top