Hosted App Model

Propose new features and changes
robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

Hosted App Model

Post by robodesign » 11 Aug 2020, 03:24

Hello!

I just discovered this new technology in Windows 10 ... Hosted Application Model [HAM]:

https://blogs.windows.com/windowsdeveloper/2020/03/19/hosted-app-model/

It would seem that this would allow people to integrate AHKs as apps into Windows, without redistributing the AHK binaries and «compiling»/packaging .... Are there any plans to support this?

I am very interested in this because it would solve the never ending saga with false-positive virus warnings. AHK itself is rarely labeled as a virus, however when we «compile»/package scripts, they are immediately flagged as malware. So, HAM would no longer require us to package stuff...

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.

lexikos
Posts: 9560
Joined: 30 Sep 2013, 04:07
Contact:

Re: Hosted App Model

Post by lexikos » 11 Aug 2020, 04:06

"HAM" is for "modern apps". If you are packaging your script as a "modern app", there is no reason you couldn't just include an AutoHotkey binary in the package.

For the hosted app to work, the host must be installed. It's not clear from the article whether this dependency would be handled automatically by the Windows Store or the user would have to install the host manually. Having AutoHotkey.exe in a separate package to your script will not make it any less likely to be flagged as a virus.

In any case, I currently do not plan to publish AutoHotkey on the Windows Store - but someone else has done it (see related topic). Perhaps you could contact @Weatherlight about making his app a host, if it isn't already. I expect it only requires changes to the packaging, not AutoHotkey itself.

robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

Re: Hosted App Model

Post by robodesign » 11 Aug 2020, 08:39

Yes, the main benefit would be derived from having the dependencies auto-magically taken care of.... otherwise , not much to be gained from.

And yes, i could distribute some of my applications as APPX [/«modern apps»] where I could have the original ahk binary.

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.

lexikos
Posts: 9560
Joined: 30 Sep 2013, 04:07
Contact:

Re: Hosted App Model

Post by lexikos » 11 Aug 2020, 21:59

You call it a benefit, but how is it? You have to write the dependency in the appx. Surely it would be just as easy or easier to include the exe instead.

I don't get your second point. If you want to use HAM, I'm fairly certain you have no choice about whether to use appx. Appx packages are what define the host and hosted app.

robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

Re: Hosted App Model

Post by robodesign » 12 Aug 2020, 04:48

I don't get your second point. If you want to use HAM, I'm fairly certain you have no choice about whether to use appx. Appx packages are what define the host and hosted app.
Yes, you are correct. I was not clear enough. I meant without HAM. Right now, I distribute my applications as ZIP files [portable] and the EXE is a «compiled» script [with ahk2exe], on this forum and elsewhere. On Windows Store , I have them as APPX.

My gripe is that the contents of the ZIP files I publish are often/always getting flagged as malware... however , if I use the original ahk binary [to reduce the likelihood of it being flagged], it has its own title/description/icon that simply do not match with my applications... If I change only these, the file signature changes, so I am stuck.

And here comes my enthusiasm with HAM: If I understand correctly, the scripts could be «hosted» and treated individually as distinct applications and recognized as such, with their own title, icon, description and so on. And if Windows 10 manages nicely dependencies, then I could offer the ZIP without any EXE, it would only ask of users to install the interpreter to run the app. This would, theoretically, help with avoiding false-positive virus warnings and have a «custom identity» for the scripts.

Hopefully, I was clear enough now...

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.

Weatherlight
Posts: 19
Joined: 20 Mar 2020, 14:49
Contact:

Re: Hosted App Model

Post by Weatherlight » 07 Jan 2022, 03:54

Damn... I totally missed that post. I just implemented this, the update is currently with Microsoft in certification.

Weatherlight
Posts: 19
Joined: 20 Mar 2020, 14:49
Contact:

Re: Hosted App Model

Post by Weatherlight » 10 Jan 2022, 07:02

@robodesign
The certification just went through. So you can now reference the store version.

robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

Re: Hosted App Model

Post by robodesign » 10 Jan 2022, 09:21

Weatherlight wrote:
10 Jan 2022, 07:02
@robodesign
The certification just went through. So you can now reference the store version.
Thank you . Can you please elaborate provide examples how I could do this?
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.

Weatherlight
Posts: 19
Joined: 20 Mar 2020, 14:49
Contact:

Re: Hosted App Model

Post by Weatherlight » 23 Jan 2022, 02:23

So I finally had time to get you a sample. This example is an AHK script that runs using the AHK Store Edition while "appearing" to be a stand alone app.

Link to the Store: https://www.microsoft.com/store/apps/9P7VNTZ4PC0X. The script requires to have AHK Store Edition installed otherwise the installation will fail.

And that would be the code of the AppxManifest:

Code: Select all

<?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:uap10="http://schemas.microsoft.com/appx/manifest/uap/windows10/10" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" IgnorableNamespaces="uap uap10 rescap build" xmlns:build="http://schemas.microsoft.com/developer/appx/2015/build">
    <Identity Name="HaukeGtze.WindowSpy.ahk" Publisher="CN=BFF8D712-89E6-4205-9504-3AB824A94414" Version="1.0.5.0" ProcessorArchitecture="x64" />
  <!-- Publisher for Testing: CN=Hauke Gotze, O=Hauke Gotze, S=Schleswig-Holstein, C=DE -->
  <!-- Publisher for Release: CN=BFF8D712-89E6-4205-9504-3AB824A94414 -->  
    <Properties>
        <DisplayName>WindowSpy.ahk</DisplayName>
        <PublisherDisplayName>Hauke Hasselberg</PublisherDisplayName>
        <Logo>Assets\Store50x50Logo.scale-100.png</Logo>
    </Properties>
    <Dependencies>
        <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.19041.0" MaxVersionTested="10.0.19041.0" />
        <uap10:HostRuntimeDependency Name="HaukeGtze.AutoHotkeypoweredbyweatherlights.com" Publisher="CN=BFF8D712-89E6-4205-9504-3AB824A94414" MinVersion="1.0.0.0" />
    </Dependencies>
    <Resources>
        <Resource Language="EN-US" />
    </Resources>
    <Applications>
        <Application Id="WindowSpy" uap10:HostId="AutohotkeyHost" uap10:Parameters="WindowSpy.ahk">
            <uap:VisualElements DisplayName="WindowSpy" Description="WindowSpy" BackgroundColor="transparent" Square150x150Logo="Assets\Ahk2Exe.exeSquare150x150Logo.scale-100.png" Square44x44Logo="Assets\Ahk2Exe.exeSquare44x44Logo.scale-100.png">
                <uap:DefaultTile Square71x71Logo="Assets\Ahk2Exe.exeSquare71x71Logo.scale-100.png" />
            </uap:VisualElements>
        </Application>
    </Applications>
    <Capabilities>
        <rescap:Capability Name="runFullTrust" />
    </Capabilities>
</Package>
This is a first "basic" sample. I will see that else can be done (registering packages) and implement it in not to distant future. I also attached my files aswell as the usable MSIX package as attachments.

Please update Autohotkey from the Store before running the sample since I had to modify the Host stuff a little to make it work.
Attachments
HaukeGtze.WindowSpy.ahk_1.0.5.0_x64__6bk20wvc8rfx2.zip
(35.07 KiB) Downloaded 54 times
Sample-HA.zip
(36.6 KiB) Downloaded 54 times

Post Reply

Return to “Wish List”