Notepad++ UWP package in Windows store - almost there



  • @Alan-Kilborn No, it shouldn’t be. This takes the .exe file (already generated) that is currently used, and then packages it up. So you would have to make a regular installer anyway to use this method. Which, at that point, why stop supplying it if you are going to do it anyway?



  • Besides, Windows 7 still has 46.63% usage, according to https://www.netmarketshare.com/operating-system-market-share.aspx?qprid=10&qpcustomd=0, and Windows 10 only has 29.26% usage.

    You don’t want to abandon more than half the market overnight, now do you? :)



  • I just posted all of my instructions to build an AppX with my tweaks and improvements on GitHub. I will post a copy here.

    Instructions:

    1. Make sure a proper base image is installed, run DesktopAppConverter app as Admin.
    2. In this example, directory system looks like:
    • Downloads
      • npp.7.5.1.Installer.exe
      • notepad++ (folder)
        • npp.build (folder, always use for current build)
          • cert.pfx
          • mynamehere.cer
          • PackageFiles (folder)
            • Assets (folder)
            • localization (folder)
            • plugins (folder)
            • VFS (folder)
            • notepad++.exe
            • AppxManifest.xml
            • [Various other system-generated files…]
        • npp.build.11.10.2017 […]
        • npp.build.11.09.2017 […]
    1. Always rename a build, once completed, to have the date added at the end. This is important - the “npp.build” folder should only be used for latest build.
    2. Run command similar to this from Downloads folder:
    DesktopAppConverter.exe -Installer npp.7.5.1.Installer.exe -InstallerArguments "/S /noUpdater" -Destination notepad++ -PackageName "npp.build" -Publisher "CN=GJSMan" -Version 7.5.1.0
    
    cd notepad++\np.build\PackageFiles
    
    1. Now, copy the AppxManifest.xml file from the previous build, overwriting the AppxManifest.xml that is in the current folder. If this is your first build, don’t do this, and edit AppxManifest.xml to match the file listed at the bottom of this post.
    cp ../../npp.build.11.10.2017/AppxManifest.xml AppxManifest.xml
    
    1. Edit the newly-copied AppxManifest.xml file, updating the version number on line 3. Don’t make any other modifications.

    2. Make the AppX:

    cd ..
    
    MakeAppx pack /v /h SHA256 /d "PackageFiles" /p Notepad++.appx
    

    NOTE: When doing this for the first time, you must add C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x86 to the Path attribute in Environment Variables for this to work, and restart PowerShell.
    If you are using a different build than 16299, you should open the folder in File Explorer and adjust accordingly.

    1. Sign the AppX, so you can install and test:
      A) Copy the certificate already generated (see below if this is your first time) from your previous build into the npp.build folder.
      B) Run:
    signtool sign /fd SHA256 /a /f mycert.pfx /p MYSECRETPASSWORDHERE MyPackage.appx
    

    If doing this for the first time, you must generate a private certificate on your computer, then copy the .pfx and .cer files into the npp.build folder, then use that to sign.

    • To clarify, the .cer is the public key (the exported one), whereas the .pfx is used for signing and is private.
    • You must have the Environment Variable in Step 7 set for this to work.
    • You only need to generate the certificate one time. After this, again, just copy-and-paste the certificate from the previous build into the new one.

    To generate the certificate (if this is your first build):
    A) New-SelfSignedCertificate -Type Custom -Subject "CN=<YourNameHere>" -KeyUsage DigitalSignature -FriendlyName <Your Friendly Name> -CertStoreLocation "Cert:\LocalMachine\My"
    B) Set-Location Cert:\LocalMachine\My
    C) Get-ChildItem | Format-Table Subject, FriendlyName, Thumbprint
    D) $pwd = ConvertTo-SecureString -String <Your Password> -Force -AsPlainText
    E) Export-PfxCertificate -cert "Cert:\LocalMachine\My\<Certificate Thumbprint>" -FilePath C:\Users\myname\Downloads\notepad++\npp.build\cert.pfx -Password $pwd
    F) cd C:\Users\myname\Downloads\notepad++\npp.build
    G) Open “Manage Computer Certificates” from Search box in Windows 10.
    H) Double click “Personal” > “Certificates”
    I) Right click, “All Tasks” > Export
    J) Next, “No, I do not want to export the private key”, “DER Encoded Binary”, and save to C:\Users\myname\Downloads\notepad++\npp.build\mynamehere.cer. “Next”, “Finish.”
    K) Update your AppxManifest.xml file to use “CN=YourNameHere” and update your publisher names in that file.
    L) Go to the top, part B above this. Run signtool using your newly-generated .pfx.

    1. Double click the .cer once signed, and Install it to “Trusted People.”
    2. Double click the .appx just generated, and click Install.

    Additional Notes:

    This is the default AppX. When building a build for the first time, you must copy and paste this AppX over the generated one.

    <?xml version="1.0" encoding="utf-8"?>
    <Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:uap2="http://schemas.microsoft.com/appx/manifest/uap/windows10/2" xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3" xmlns:uap4="http://schemas.microsoft.com/appx/manifest/uap/windows10/4" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" xmlns:rescap3="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities/3" xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10" xmlns:desktop2="http://schemas.microsoft.com/appx/manifest/desktop/windows10/2" xmlns:com="http://schemas.microsoft.com/appx/manifest/com/windows10" xmlns:wincap3="http://schemas.microsoft.com/appx/manifest/foundation/windows10/windowscapabilities/3" IgnorableNamespaces="uap4 wincap3 rescap3 desktop2 com">
      <Identity Name="npp.build" ProcessorArchitecture="x86" Publisher="CN=GJSMan" Version="7.5.1.6" />
      <Properties>
        <DisplayName>Notepad++</DisplayName>
        <PublisherDisplayName>GJSMan</PublisherDisplayName>
        <Logo>Assets\StoreLogo.png</Logo>
      </Properties>
      <Resources>
        <Resource Language="en-us" />
        <Resource uap:Scale="100" />
        <Resource uap:Scale="125" />
        <Resource uap:Scale="150" />
        <Resource uap:Scale="200" />
        <Resource uap:Scale="400" />
      </Resources>
      <Dependencies>
        <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14393.0" MaxVersionTested="10.0.16299.15" />
      </Dependencies>
      <Capabilities>
        <rescap:Capability Name="runFullTrust" />
        <Capability Name="internetClient" />
      </Capabilities>
      <Applications>
        <Application Id="npp.build" Executable="notepad++.exe" EntryPoint="Windows.FullTrustApplication">
          <uap:VisualElements DisplayName="Notepad++" Description="npp.build" BackgroundColor="transparent" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png">
            <uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" Square310x310Logo="Assets\Square310x310Logo.png" Square71x71Logo="Assets\Square71x71Logo.png">
              <uap:ShowNameOnTiles>
                <uap:ShowOn Tile="square150x150Logo" />
                <uap:ShowOn Tile="wide310x150Logo" />
                <uap:ShowOn Tile="square310x310Logo" />
              </uap:ShowNameOnTiles>
            </uap:DefaultTile>
          </uap:VisualElements>
          <Extensions>
            <uap3:Extension Category="windows.appExecutionAlias" Executable="notepad++.exe" EntryPoint="Windows.FullTrustApplication">
              <uap3:AppExecutionAlias>
                <desktop:ExecutionAlias Alias="notepad++.exe" />
              </uap3:AppExecutionAlias>
            </uap3:Extension>
    		<uap:Extension Category="windows.fileTypeAssociation">
              <uap3:FileTypeAssociation Name="npp.build">
    		   <uap:SupportedFileTypes>
                  <uap:FileType>.txt</uap:FileType>
                  <uap:FileType>.log</uap:FileType>
    			  <uap:FileType>.ini</uap:FileType>
    			  <uap:FileType>.inf</uap:FileType>
    			  <uap:FileType>.h</uap:FileType>
    			  <uap:FileType>.hh</uap:FileType>
    			  <uap:FileType>.hpp</uap:FileType>
    			  <uap:FileType>.hxx</uap:FileType>
    			  <uap:FileType>.c</uap:FileType>
    			  <uap:FileType>.cpp</uap:FileType>
    			  <uap:FileType>.cxx</uap:FileType>
    			  <uap:FileType>.cc</uap:FileType>
    			  <uap:FileType>.m</uap:FileType>
    			  <uap:FileType>.mm</uap:FileType>
    			  <uap:FileType>.vcxproj</uap:FileType>
    			  <uap:FileType>.vcproj</uap:FileType>
    			  <uap:FileType>.props</uap:FileType>
    			  <uap:FileType>.vsprops</uap:FileType>
    			  <uap:FileType>.manifest</uap:FileType>
    			  <uap:FileType>.java</uap:FileType>
    			  <uap:FileType>.cs</uap:FileType>
    			  <uap:FileType>.pas</uap:FileType>
    			  <uap:FileType>.pp</uap:FileType>
    			  <uap:FileType>.inc</uap:FileType>
    			  <uap:FileType>.html</uap:FileType>
    			  <uap:FileType>.htm</uap:FileType>
    			  <uap:FileType>.shtml</uap:FileType>
    			  <uap:FileType>.shtm</uap:FileType>
    			  <uap:FileType>.htaccess</uap:FileType>
    			  <uap:FileType>.asp</uap:FileType>
    			  <uap:FileType>.aspx</uap:FileType>
    			  <uap:FileType>.css</uap:FileType>
    			  <uap:FileType>.js</uap:FileType>
    			  <uap:FileType>.json</uap:FileType>
    			  <uap:FileType>.jsm</uap:FileType>
    			  <uap:FileType>.jsp</uap:FileType>
    			  <uap:FileType>.php</uap:FileType>
    			  <uap:FileType>.php3</uap:FileType>
    			  <uap:FileType>.php4</uap:FileType>
    			  <uap:FileType>.php5</uap:FileType>
    			  <uap:FileType>.phps</uap:FileType>
    			  <uap:FileType>.phpt</uap:FileType>
    			  <uap:FileType>.phtml</uap:FileType>
    			  <uap:FileType>.xml</uap:FileType>
    			  <uap:FileType>.xhtml</uap:FileType>
    			  <uap:FileType>.xht</uap:FileType>
    			  <uap:FileType>.xul</uap:FileType>
    			  <uap:FileType>.kml</uap:FileType>
    			  <uap:FileType>.xaml</uap:FileType>
    			  <uap:FileType>.xsml</uap:FileType>
    			  <uap:FileType>.sh</uap:FileType>
    			  <uap:FileType>.bsh</uap:FileType>
    			  <uap:FileType>.bash</uap:FileType>
    			  <uap:FileType>.nsi</uap:FileType>
    			  <uap:FileType>.nsh</uap:FileType>
    			  <uap:FileType>.lua</uap:FileType>
    			  <uap:FileType>.pl</uap:FileType>
    			  <uap:FileType>.pm</uap:FileType>
    			  <uap:FileType>.py</uap:FileType>
    			  <uap:FileType>.rc</uap:FileType>
    			  <uap:FileType>.as</uap:FileType>
    			  <uap:FileType>.mx</uap:FileType>
    			  <uap:FileType>.vb</uap:FileType>
    			  <uap:FileType>.vbs</uap:FileType>
    			  <uap:FileType>.f</uap:FileType>
    			  <uap:FileType>.for</uap:FileType>
    			  <uap:FileType>.f90</uap:FileType>
    			  <uap:FileType>.f95</uap:FileType>
    			  <uap:FileType>.f2k</uap:FileType>
    			  <uap:FileType>.tex</uap:FileType>
    			  <uap:FileType>.sql</uap:FileType>
    			  <uap:FileType>.nfo</uap:FileType>
    			  <uap:FileType>.mak</uap:FileType>
                </uap:SupportedFileTypes>
                <uap2:SupportedVerbs>
                  <uap3:Verb Id="Edit" Parameters="&quot;%1&quot;">Edit with Notepad++</uap3:Verb>
                </uap2:SupportedVerbs>
              </uap3:FileTypeAssociation>
            </uap:Extension>
          </Extensions>
        </Application>
      </Applications>
    </Package>
    

    Copy and paste this in to AppxManifest.xml for the first build.
    To clarify, you must copy this over the AppxManifest.xml file on your first build, then copy the AppxManifest.xml from the previous build every time you make a new build.



  • @Alan-Kilborn

    I hope that the Windows store (ugh!) won’t be the ONLY way to get Notepad++ moving forward…

    Not sure about what are you talking about. If you’re talking about the way to get Notepad++ installed, there will be the same distribution way via notepad-plus-plus.org, plus Windows Store’s distribution. So users have more choice.



  • @Claudia-Frank

    DesktopAppConverter -Cleanup "All" -Verbose
    

    works well, and install the new image without problem. Thank you.

    I’ll let you know if I can make an UWP package.



  • @gjsman

    I have tried Windows convension Bridge several times, I have never managed to get UWP from it. In anyway, it’s impossible to build any distribution from a 3rd party server, not only for the reliability reason, but also for the security reason.

    Thank you very much for the very detail info. It helps me a lot.



  • @donho

    “In anyway, it’s impossible to build any distribution from a 3rd party server, not only for the reliability reason, but also for the security reason.”

    What do you mean? Do you mean that Notepad++ remixes can’t be built? Or are you talking about something else?

    “Thank you very much for the very detail info. It helps me a lot.”

    Great! I don’t want to make things to complicated, and you can just use that simple command, but it won’t be an ideal experience without the modifications I put in those instructions (the main change is that you can open files from File Explorer, because file associations as they were done in the past don’t work, and without this you would have to go File > Open for every file you wanted to open).

    If you need additional help let me know. :)



  • “I have tried Windows convension Bridge several times, I have never managed to get UWP from it.”

    @donho With the conversion bridge, you CAN use UWP APIs, XAML, and more features (You just have to code for it)

    https://docs.microsoft.com/en-us/windows/uwp/porting/desktop-to-uwp-extend

    Here is some supplied (example) C++:

    DllExport bool __stdcall LaunchMap(double lat, double lon)
    {
      try
      {
        String ^str = ref new String(L"desktopbridgemapsample://");
        Uri ^uri = ref new Uri(
          str + L"location?lat=" + lat.ToString() + L"&?lon=" + lon.ToString());
    
        // now launch the UWP component
        Launcher::LaunchUriAsync(uri);
      }
      catch (Exception^ ex) { return false; }
      return true;
    }
    


  • @donho If you meant that you never got a successful result from the bridge, that is odd. In my case, the biggest issue I had was needing Windows 10 Pro (because Home doesn’t include Hyper-V).

    So, goal here: Getting the basic UWP package working. When you get basic UWP builds working (without modifications), I would actually publish it to the Store like that. Improvements that require more build steps (like my modifications) can come later. :)

    Remember, Desktop-converted apps require special permission from Microsoft to be published. They charge $19 for an Individual’s Store account (this is for everyone), and they don’t charge for publishing converted Desktop apps, but they do require you fill out a special form asking for permission. After all, desktop apps (even packaged as UWP) still have far more control over the system than regular, new UWP apps do.

    https://developer.microsoft.com/en-us/windows/projects/campaigns/desktop-bridge

    In fact, Microsoft would prefer you filled out this form sooner than later, by the sound of it. It is also implied that they will help with any problems or questions. Also, they have a tendency to actually seek out apps they deem important and ask their developers to bring them to the store - they would probably really want you to bring Notepad++ to the store and would probably be more than happy to help you.



  • @donho Any luck?



  • I @donho I’m Francesco from UWP Open Source Community, I see that you are working hard on conversion…but I don’t understand why you can’t complete the first step…would you restart from a blank canvass with us( @gjsman @claudia-frank )?
    Futhermore, with the last windows update (Fall Creator Update) is possible distribute UWP also in your own website, check here:
    https://blogs.msdn.microsoft.com/appinstaller/2017/09/26/uwp-app-installs-from-web-via-app-installer/[link text](link url)



  • @Francesco-Venuti

    Just wanted to let you know that I’m not really up to date about UWP
    because I stopped using windows operating systems some time ago.
    So I don’t think that I can bring in useful knowledge but if there is, I will certainly do.

    Cheers
    Claudia



  • @donho @Francesco-Venuti

    I have packaged it successfully… more trying to get @donho to successfully package it.

    Any luck at all?



  • https://redd.it/84rxxt

    https://www.microsoft.com/en-au/store/p/npp/9plhc123mqwt

    Just saw this today. Is this official? Should I be worried if it isn’t by the original team?

    Thanks.



  • @Nobel-Harvards

    it is from windows store so … I guess it is safe … somehow,
    but don’t know which version they provide and how often they build new packages
    but if this is irrelevant to you I would think you can go for it.

    Just my two cents.

    Cheers
    Claudia



  • @Claudia-Frank @Nobel-Harvards You might have seen my posts above about how I packaged it. I am not the person who put it on the store, however. I have no idea who NightRise is. Just letting you know - even though I posted a lot on how to do it, I am not the same person.



  • Hi folks - that would be me who put it in the store… i really really really really needed it for a not-for-profit I am helping out (thank you Windows 10S).

    Code modifications were required to get Microsoft to approve it… so I did have to fork the code. Modifications, and the packaged application (so folks can verify it) is all located here: https://github.com/NightRi-se/notepad-plus-plus

    Any questions do let me know, also happy to transfer this app to the official “notepad++” team to maintain if they would like it. Until then… I am happy to keep it going on the store.



  • @Claudia-Frank The store version is built of 7.5.5 (calling the store version 7.55.buildnumber.0). Most of the updates I have been posting have been to get settings to save/work correctly in UWP land, get file associations working, and next step is getting the x64 plugin manager in there and working.

    @Nobel-Harvards no not official… it is a clone. If you can think of a better way to make that clear let me know.

    @gjsman sorry if you got a bad wrap for this - also great work above… I didn’t see this announcement before going down this line however. For Windows 10S there is a bunch of policy’s that MS requires you comply by (with a possible fine of $15 per download if you app breaches them). One of those is no run, or ability to get to command. … it took about 4 weeks of going back and forth to get this working, approved, and published (initially it was published hidden/privately… but some friends wanted to use it, so I recently moved it to be public).



  • @jakevis

    Dude, seriously, don’t you think this is a little bit presumptuous? If this “store” thing is to happen, shouldn’t @donho be the one to do it? I mean, at the end of the day, it is his software…he’s the “benevolent dictator” after all…

    Sure, it’s open source, and you can pretty much do with it what you’d like, but, I don’t know, creating an unauthorized distribution channel seems to push the boundaries…

    and next step is getting the x64 plugin manager in there and working

    So it was @donho’s decision to remove the PluginManager from the distribution…and you can just arbitrarily decide to add it back in? Again, seems quite, well…presumptuous…

    So now people will report bugs against some version of Notepad++, but probably no one will be really sure which one. (Will the real Notepad++ please stand up?)

    Now if you’re doing all this with @donho’s approval and blessing, then I retract all of the above…



  • @Scott-Sumner your right, one thing lead to another - and I had a np++ clone in the store and users were finding it, so I just opened it up to the public. No blessings given.

    I am trying to make it as clear as possible that this is a clone - and I will totally pull it when there is an “official” version avalible (or someone can convert this to an official one if they prefer). I cant say I care much either way… other than I need one in the store for the moment.

    Re the plugin manager. I wasn’t aware of this… but interesting thing about an official store is folks provide reviews… and a plugin manager is the number 1 thing folks are complaining about (now the persistent settings issues, and file association issues are corrected), or asking for. Folks seem to be creating issues there in the reviews, or as instructed, against my fork in GitHub. Here is the plugin manager issue: https://github.com/NightRi-se/notepad-plus-plus/issues/10

    Another interesting tidbit… MS failed this app for store certification on one round due to the certifier being unable to load a plugin… [they did try to load a 32bit plugin, and this fork is 64bit only].

    Ill let @donho weigh in as to his thought on all this. yes, boundaries pushed and as per the reddit thread, folks are split if this is a good thing or not. But due to the store requirements, this is a true fork, with code changes to support (that will have to be maintained for the app to stay in the store).


Log in to reply