Giter Site home page Giter Site logo

syedhassaanahmed / kiosk-demo-electron Goto Github PK

View Code? Open in Web Editor NEW
75.0 6.0 15.0 3.6 MB

Package and distribute Electron Apps and run them in Kiosk mode on Windows 10

License: MIT License

JavaScript 27.88% CSS 0.77% HTML 9.42% PowerShell 60.69% Dockerfile 1.25%
msi electron-packager docker electron wix-toolset powershell winehq winetricks windows-10 appveyor

kiosk-demo-electron's Introduction

kiosk-demo-electron

Build status

This repository demonstrates how to package and distribute an Electron App which runs in Kiosk mode on Windows 10. It uses the Windows 10 Shell Launcher as well as set the kiosk user to AutoLogon. Packaging the app as an MSI makes sure we can distribute it to multiple kiosks via an MDM solution e.g Microsoft Intune.

Note: Shell Launcher feature requires Windows 10 Enterprise Edition.

The project is described in-depth in this blog post

Create Installer

Windows

npm run dist will build everything and create the MSI in dist folder.

Linux

Use npm run dist:wine. Script assumes that Wine and dotnet45 (using winetricks) are installed and properly configured. If the full path of any of your electron-packager output files is longer than 128 chars, you'll run into error LGHT0103 : The system cannot find the file. Note: Light.exe has a known issue with MSI validation on Wine so it had to be turned off with -sval flag.

Docker

npm run dist:docker will spin up an instance of this image, execute the above wine script and then copy artifacts back to host's dist folder. Script assumes that Docker daemon is running on host.

Configure

Kiosk parameters are passed to the installer like this:

KioskDemoElectron.msi KIOSK_USERNAME=<kiosk user> KIOSK_PASSWORD=<kiosk password>

All params have a default value as can be seen in product.wxs.

How it works

  • First we package the app using electron-packager
  • Then we harvest binaries produced by electron-packager using WiX's Heat tool.
  • We also copy our PowerShell script into the root of electron-packager output. We could let the harvester take care of PowerShell files as well, but we wanted to explicitly specify them in product.wxs with Custom Actions.
  • Output of harvest tool is heat.wxs which contains a Fragment with list of files. We take that as well as product.wxs and pass it to the Candle tool. Candle is responsible for preprocessing .wxs files and generates compiled .wixobj files.
  • Finally we use the Light tool to generate MSI from .wixobj.
  • PowerShell Scripts are executed from WiX Custom Actions.

Why WiX instead of electron-winstaller (Squirrel.Windows)?

In our case, WiX provides lot of flexibility in terms of configuring the installer;

  • Passing params to the setup
  • Executing elevated PowerShell during install/uninstall events
  • Modifying config files based on setup params

Troubleshoot

MSI logging can be enabled by executing the installer like this:

msiexec /i "setup.msi" /l*v "msi.log" PARAM=VALUE

PowerShell log will be written in C:\Windows\SysWOW64\powershell.log.

Telemetry

The solution uses Application Insights to collect basic telemetry data from the app. To enable it, please create an environment variable named APPINSIGHTS_INSTRUMENTATIONKEY and set it to the Instrumentation Key obtained from Azure portal.

kiosk-demo-electron's People

Contributors

basecode avatar bnookala avatar dependabot[bot] avatar syedhassaanahmed avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

kiosk-demo-electron's Issues

Setting Custom Shell

hey there! Thanks for your kiosk-biolerplate.

I am having problems running your Install-ShellLauncher.ps1 script.
I am running it in an elevated Powershell and invoke your Skript like this:
(a bit redacted)

 .\Install-ShellLauncher.ps1 kioskuser C:\Users\kioskuser\projects\myexe.exe
08/22/2017 19:42:19 Shell Launcher Enabled is set to True

08/22/2017 19:42:19 userName is kioskuser 

08/22/2017 19:42:19 Cashier_SID is S-1-5-21-3723059876-2847769641-3209782291-XXX
08/22/2017 19:42:19 exeName is C:\Users\kioskuser\projects\myexe.exe

08/22/2017 19:42:19 New settings for custom shells:

08/22/2017 19:42:19 @{Sid=S-1-5-21-3723059876-2847769641-3209782291-XXX
; Shell=C:\Users\kioskuser\projects\myexe.exe; DefaultAction=0}

Logging in now with my main user, Shows now a black Shell and not a Default Shell.
Also using kioskuser does not start myexe.exe.
Running the Uninstaller resets back the the Default Shell.

What is the best way to debug the Problem?

Windows 10 (1803) - Black screen on kiosk user launch

Hi, we have successfully built and installed and set up the kiosk user, however, the electron app does not launch. We just get a black screen (explorer.exe does not launch). Here is the install log:

11/16/2018 09:34:43 Shell Launcher Enabled is set to True

11/16/2018 09:34:43 Default Shell is set to explorer.exe and the default action is set to 0

11/16/2018 09:34:43 UserName is kiosk

11/16/2018 09:34:43 Cashier_SID is S-1-5-21-64846573-2525431716-3060751376-1002

11/16/2018 09:34:43 ExeName is C:\Program Files (x86)\Kiosk Demo Electron\kiosk-demo-electron.exe

11/16/2018 09:34:43 New settings for custom shell:

11/16/2018 09:34:43 @{PSComputerName=JIMBO; __GENUS=2; __CLASS=WESL_UserSetting; __SUPERCLASS=; __DYNASTY=WESL_UserSetting; __RELPATH=WESL_UserSetting.Sid="S-1-5-21-64846573-2525431716-3060751376-1002"; __PROPERTY_COUNT=5; __DERIVATION=System.String[]; __SERVER=JIMBO; __NAMESPACE=root\standardcimv2\embedded; __PATH=\JIMBO\root\standardcimv2\embedded:WESL_UserSetting.Sid="S-1-5-21-64846573-2525431716-3060751376-1002"; CustomReturnCodes=; CustomReturnCodesAction=; DefaultAction=0; Shell=C:\Program Files (x86)\Kiosk Demo Electron\kiosk-demo-electron.exe; Sid=S-1-5-21-64846573-2525431716-3060751376-1002; Scope=System.Management.ManagementScope; Path=\JIMBO\root\standardcimv2\embedded:WESL_UserSetting.Sid="S-1-5-21-64846573-2525431716-3060751376-1002"; Options=System.Management.ObjectGetOptions; ClassPath=\JIMBO\root\standardcimv2\embedded:WESL_UserSetting; Properties=System.Management.PropertyDataCollection; SystemProperties=System.Management.PropertyDataCollection; Qualifiers=System.Management.QualifierDataCollection; Site=; Container=}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.