How to wrap web app to windows 10 desktop app? - windows

I have a web application (accessed by clients using standard browser) which is available on custom individual url for each client and I would like to "generate" a "custom desktop application" (probably zip file with some exe file and some xml config file - where exe runs webview with url from xml) which can be installed on clients computer (Windows 10 support only is ok). This application when launched will open frameless window (no menu, no url bar etc) of a custom size with webview opening the defined https url (url will contain secret login hash for user / or session must be kept even after computer restart etc ..). This app should run only online (no offline mode needed).
The goal is to take one simple specific proces (entering simple data) from a complex web application and make this simple process easilly accessible for users (just click icon and enter data, submit to server, close, no login ever needed).
I have no experience developing for Windows 10, but I expect there must be some easy "universal app" solution as probably more developers are solving the same problem. What are the most (time) effective, but standard and safe possibilities?

I found a nice tutorial: https://www.todesktop.com/guides/nativefier. This tool is based on Node.js, which works fine on macOS, Windows, or Linux.
First, install Node.js on your computer. Then, run
npm i nativefier -g
to install nativefier. You can wrap your web app into native app simply by running
nativefier "your-url" --name "Application Name"
You can read the post for further information, like code signing your application, generating native installers, etc.

Related

How to hide terminal shell on server application like Warp in Windows?

I have a small warp server project on Windows that listen to a particular port and do something whenever I send a command to it by REST (for example: POST http://10.10.10.1:5000/print). It's a small client for printing PDF / receipt directly from another computer.
It works. But my problem is when I had to package the whole project, the Rust compiler give me an executable file (.exe). The application displays a terminal window when I run it. I want this terminal to be hidden somehow.
I try to run the program as a windows service (by using NSSM). It doesn't work for me since I had to access the printer. Windows doesn't allow my app to access any devices or any other executable as a windows service. (The reasons are explained here: How can I run an EXE program from a Windows Service using C#?)
So I plan to run my app as a tray-icon application so user can control or close the app. (https://github.com/olback/tray-item-rs)
Unfortunately, I still cannot hide the app's terminal window.
Another solution that I found is hstart (https://www.ntwind.com/software/hstart.html). But I would like to use this as "the last resort" solution since many antivirus/windows defender mark it as a malware.
Do anyone know how to hide or get rid of it ?
After lot of searching, It turns out to be easier than I thought. Just add
#![windows_subsystem = "windows"]
on top of your main.rs file. (for rust > 1.18) and the terminal is gone.
These control the /SUBSYSTEM flag in the linker. For now, only
"console" and "windows" are supported.
When is this useful? In the simplest terms, if you're developing a
graphical application, and do not specify "windows", a console window
would flash up upon your application's start. With this flag, it
won't.
https://doc.rust-lang.org/reference/runtime.html#the-windows_subsystem-attribute
https://blog.rust-lang.org/2017/06/08/Rust-1.18.html
https://learn.microsoft.com/en-us/cpp/build/reference/subsystem-specify-subsystem?view=msvc-170

How do I start a desktop application from the browser on a Mac?

I'm building a web application that when finished will need to trigger a desktop app to open and load a specific file (or connect to a URL I'm passing to the desktop app).
I'm having a hard time finding documentation about how to do that on a Mac, can you point me to the right place?
You want to define a custom URL protocol.
Here is an example;
http://weblogs.asp.net/morteza/How-to-run-a-desktop-application-from-a-web-page
Here are some notes about how to do it on a Mac;
https://superuser.com/questions/548119/how-do-i-configure-custom-url-handlers-on-os-x
https://onflapp.wordpress.com/lincastor/

Can I run my winRT application as a screensaver?

Is there a way to make my winRT application as a screen saver in xaml?
As Jerry says, there's no straightforward way to make a Windows Store app screensaver. However, there's a roundabout solution that might work for you on Windows 8, but not Windows RT. I have it nearly working. I'll share what I have so far.
A screensaver is just an executable with a .scr extension that's kept in C:\Windows\System32. For example, look at C:\Windows\System32\Bubbles.scr. The solution I have in mind is to create a .scr screensaver whose only purpose is to launch your Windows Store application, which you say will use XAML.
You can't launch a Windows Store app from the command line directly, so you'll create a launcher app. Take a look at a blog post called Automating the testing of Windows 8 apps by Ashwin Needamangala. Partway down the article, look for the section called Automating the activation of your app. It contains a sample C++ application which can launch Windows Store apps in the following way:
C:>Win8AppLaunch.exe Microsoft.BingNews_8wekyb3d8bbwe!AppexNews
The sample launcher on that page needs to be modified, but before you do that just copy the code into a C++ console app:
You're almost ready to test it out from the command line, but you need to specify the name of the app as an AppUserModelId. The details are in Ashwin's post, but to paraphrase you first want to allow the execution of PowerShell scripts on your system with:
PS C:> Set-ExecutionPolicy AllSigned
Then run this PowerShell script:
$installedapps = get-AppxPackage
foreach ($app in $installedapps)
{
foreach ($id in (Get-AppxPackageManifest $app).package.applications.application.id)
{
$app.packagefamilyname + "!" + $id
}
}
You might like running it in the Windows PowerShell ISE. It's pretty slick. Find the AppUserModelId of your app and then test Win8AppLaunch.exe from the command line, as shown above. This should launch your Windows Store app from command line.
Next, modify the C++ launcher to hard-code the AppUserModelId of your application instead of parsing it from a command line argument. I created a Gist of this. The important part is the line where I declare myApp.
Build the new executable, rename it MyScreenSaver.scr and put it in C:\Windows\System32. It will then appear in the Screen Saver Settings Control Panel. You can preview the screensaver there, and it works. However, if you wait for the screensaver to launch, it will briefly bring up a console window and never fully launch. I'm not sure why. I tried disabling the creation of the console window by switching the project to a Windows app, but that didn't help. You can try that yourself by changing Properties | Configuration | Linker | System | SubSystem to WINDOWS. It's a little more involved, as you'll also need to change the entry point from _tMain to _tWinMain. Contact me through my blog if you want the details. My StackOverflow profile lists it.
At this point it's almost fully working. You might try starting with a blank C++ screensaver that you know works, and then copy in the above code. If I get more time, maybe I'll try this myself.
Cool idea. But, no.
If you want your application to really do something for Windows other than run as a simple app, then you write an extension app. Here's the official word:
Extensions An extension is like an agreement between an app and Windows. Extensions lets app developers extend or customize standard Windows features primarily for use in their apps and potentially for use in other apps.
There are these types of extension apps right now:
Account picture provider (extension)
When users decide to change their account picture, they can either select an existing picture or use an app to take a new one. If your app can take pictures, you can use this extension to have Windows list your app in the Account Picture Settings control panel. From there, users can select it to create a new account picture. For more info about this extension, see the UserInformation reference topic. You can also check out our Account picture name sample.
AutoPlay (extension)
When the user connects a device to a computer, Windows fires an AutoPlay event. This extension enables your app to be listed as an AutoPlay choice for the one or more AutoPlay events.
Background tasks (extension)
Apps can use background tasks to run app code even when the app is suspended. Background tasks are intended for small work items that require no interaction with the user.
Camera settings (extension)
Your app can provide a custom user interface for selecting camera options and choosing effects when a camera is used to capture photos or video. For more info about this extension, see Developing Windows Store device apps for cameras.
Contact picker (extension)
This extension enables your app to register to provide contact data. Your app is included in the list of apps that Windows displays whenever the user needs access to their contacts.
For more info about this extension, see the Windows.ApplicationModel.Contacts.Provider reference topic. You can also check out Managing user contacts.
File activation (extension)
Files that have the same file name extension are of the same file type. Your app can use existing, well known file types, such as .txt, or create a new file type. The file activation extension enables you to define a new file type or register to handle a file type.
Game Explorer (extension)
Your app can register with Windows as a game. To do this, you must create a Game Definition File (GDF), build it as a binary resource in your app, and declare that resource in the package manifest.
Print task settings (extension)
You can design an app that displays a custom print-related user interface and communicates directly with a print device. When you highlight the features that are specific to a particular make and model of print device, you can provide a richer, more enhanced user experience.
Protocol activation (extension)
Your app can use existing protocols for communication, such as mailto, or create a custom protocol. The protocol activation extension enables you to define a custom protocol or register to handle an existing protocol.
SSL/certificates (extension)
Digital certificates are used to authenticate one entity to another. For example, certificates are often used to authenticate a user to web services over SSL. This extension enables you to install a digital certificate with your app.
cite: http://msdn.microsoft.com/en-us/library/windows/apps/hh464906.aspx
Unfortunately, nothing has to do with screen savers. The technical reason, at this time, you cannot write a Windows 8 app that functions as a screensaver is because Windows 8 apps are fundamentally tied to run inside the WinRT execution environment. That shell does not extend out past the Start menu in this current version of Windows. So, there's no way to execute outside - like as a screen saver. Screen savers are still built the "old fashion way".

Developing spotify apps under Windows 7 64Bit - Application keys

I have a perfect developer account now, copied the 32bit file libspotify.dll to SYSWOW64. I have the developer menu in my spotify client. When I try to open the inspector, a blue message appears: "choose the app you wanna inspect". I try to inspect a random app, but nothing happens. To develop my own, or try the examples I need an application key. But the form doesn't seem to do anything: https://developer.spotify.com/technologies/libspotify/#application-keys
Am I missing sth.?
Spotifiy client version: 0.8.2.610.g090a06f8
The console does not reveal anything. Hotkey for the console: CTRL+ALT+HOME
libSpotify is for embedding Spotify tech into your own standalone application. If you're developing a HTML app to go inside the Spotify client, you don't need libSpotify or a libSpotify application key.
As for inspecting apps, you're only allowed to inspect your own applications. To get started, check out the documentation here and the tutorial here.

Launch Application in Mac and Windows

I have my application installed on the user's machine(both windows and mac users). Now the user also goes to my web site for certain other things. I want to provide a link in the web site which says "Launch my app". When he clicks on the link, it should launch my application, which has been installed on his system. I was thinking of going the Active X route but it is not recommended + have to use another approach for Mac. The other option was some how get a file association with my application and make it work. Is there any other option ?
You could register your application for special URL schemas, like mygreatapp://open. In the same way that an ftp://... link opens the default FTP app and a mailto://... link opens the default email application, you can register your own app for any custom [myuniqueschemahere]:// schema.
Register your app as a "helper" app for browsers as part of the installer process.
So if you have a link on your website with a URL like "prashant://thisfineapp", clicking on it launches your application.

Resources