Skip to content

bartekl1/fake-windows-update

Folders and files

NameName
Last commit message
Last commit date

Latest commit

856017d · Jan 18, 2025

History

12 Commits
Jan 18, 2025
Jan 18, 2025
Jan 18, 2025
Jan 16, 2025
Jan 18, 2025
Jan 18, 2025
Jan 18, 2025
Jan 18, 2025
Jan 18, 2025
Jan 18, 2025
Jan 18, 2025

Repository files navigation

Fake Windows Update

Fake Windows Update is a prank application that simulates a Windows Update screen. It blocks input and displays a fake update screen that looks like a real Windows Update screen. It is written in Electron and C++.

Warning

This project is still under development

Caution

This project uses Windows API to block keyboard and mouse input. It may not work on some systems or may cause problems.
Use it at your own risk!

TODO

  • Add more update screens (currently only Windows 10 is available)
  • Improve update screen and make it more realistic (partially done)
  • Improve input blocking
  • Add customization
  • Single executable file
  • Multi monitor support

Configuration

The application can be configured by adding a configs.json file to the application directory.

Configuration options

The following configuration options are available. All options are optional.

exit_after - integer

Time in seconds after which the ‘update’ should be completed and the application should be closed. Using this option will cause increasing progress. By default, the application will never automatically close and progress will be constantly set to 0%.

time_function - string

Function for calculating progress against time. The following options are available linear, quadratic, logarithmic. This option requires the exit_after option. Default is linear.

Progress is calculated using the following formulas ( P is progress, t is elapsed time and t C is total time):

linear

P = max ( min ( 100 t t C , 100 ) , 0 ) From function: P = 100 t t C

quadratic

P = min ( 100 max ( t , 0 ) 2 t C 2 , 100 ) From function: P = 100 t 2 t C 2

logarithmic

P = min ( 100 log t C ( max ( t , 1 ) ) , 100 ) From function: P = 100 log t C t

command_after_completed - string

The command to execute after the ‘update’ has been completed. By default, no command is executed.

disable_blocking - boolean

If set to true keyboard and mouse input is not blocked, the window is not opened fullscreen and on the top. Default is false.

open_dev_tools - boolean

If set to true DevTools will be opened automatically on application startup. If false DevTools can be opened manually using Ctrl + Shift + I. Default is false.

Example configuration

{
    "exit_after": 300,                                 // Complete 'update' after 5 minutes.
    "time_function": "logarithmic",                    // Calculate progress using the logarithmic function.
    "command_after_completed": "shutdown -r -t 0",     // Reboot computer after 'update' is completed
    "disable_blocking": false,                         // Block keyboard and mouse input, open application fullscreen and on the top.
    "open_dev_tools": false                            // Do not open DevTools automatically.
}

Running from source code

  1. You need to have Node.js and g++ (or any other C++ compiler) installed on your computer.

  2. Clone this repository.

git clone https://github.com/bartekl1/fake-windows-update.git
cd fake-windows-update
  1. Install dependencies.
npm install
  1. Compile block_input.cpp.

Example command for g++:

g++ block_input.cpp -o block_input.exe -static -std=c++23
  1. Run Electron app.
npm start

Building

  1. You need to have Node.js and g++ (or any other C++ compiler) installed on your computer.

  2. Clone this repository.

git clone https://github.com/bartekl1/fake-windows-update.git
cd fake-windows-update
  1. Install dependencies.
npm install
  1. Compile block_input.cpp.

Example command for g++:

g++ block_input.cpp -o block_input.exe -static -std=c++23
  1. Build Electron app.
npm run make
  1. Built app will be in out/make directory.

How to exit

  1. Press Ctrl + Alt + Del.
  2. Click Cancel or press Esc.
  3. Press Alt + F4.
  4. Close block_input.exe console window.