### Project Setup Commands Source: https://github.com/teamwork/node-auto-launch/blob/master/CONTRIBUTING.md Commands required to set up the Node Auto Launch project locally. This includes installing global dependencies like Gulp and project-specific dependencies. ```bash npm install -g gulp npm install ``` -------------------------------- ### Basic Usage Example Source: https://github.com/teamwork/node-auto-launch/blob/master/README.md Demonstrates how to initialize and use the AutoLaunch module to enable, disable, and check if an application is set to auto-launch on startup. ```javascript var AutoLaunch = require('auto-launch'); var minecraftAutoLauncher = new AutoLaunch({ name: 'Minecraft', path: '/Applications/Minecraft.app' }); minecraftAutoLauncher.enable(); //minecraftAutoLauncher.disable(); minecraftAutoLauncher.isEnabled() .then(function(isEnabled){ if(isEnabled){ return; } minecraftAutoLauncher.enable(); }) .catch(function(err){ // handle error }); ``` -------------------------------- ### AutoLaunch API Documentation Source: https://github.com/teamwork/node-auto-launch/blob/master/README.md Provides details on the AutoLaunch constructor and its methods, including options for configuration and how to manage application auto-launch behavior. ```APIDOC new AutoLaunch(options) - Constructor for the AutoLaunch module. - options: Object - name: String - The name of your app. - path: String (optional for NW.js and Electron apps) - The absolute path to your app. For NW.js and Electron apps, the path is guessed based on process.execPath. - isHidden: Boolean (Optional) - If true, launches the app in hidden mode. Defaults to false. - mac: Object (Optional) - Mac-specific options. - useLaunchAgent: Boolean (Optional) - If true, uses a Launch Agent instead of AppleScript for auto-launching on Mac. Defaults to false. .enable() - Sets your app to auto-launch at startup. - Returns a Promise. .disable() - Disables your app from auto-launching at startup. - Returns a Promise. .isEnabled() - Returns a Promise which resolves to a Boolean; true if your app is set to launch on startup. How does it work? (mac) - AppleScript (default): Uses AppleScript to instruct System Events to add or remove a Login Item. No files are involved. This method is not Mac App Store friendly. - Launch Agent: If `mac.useLaunchAgent` is true, uses a Launch Agent for auto-launching. This is an alternative to AppleScript. ``` -------------------------------- ### Publishing a New Version Workflow Source: https://github.com/teamwork/node-auto-launch/blob/master/CONTRIBUTING.md Steps involved in publishing a new version of the Node Auto Launch package. This includes passing tests, updating the version in package.json, publishing to npm, and creating a GitHub release. ```bash # 1. Ensure tests pass (Travis/AppVeyor builds successful for the last commit) # 2. Manually bump version in package.json # 3. Publish new version to npm: npm publish # 4. Commit & push version bump: git commit -m "{{new_version}}" && git push # 5. Publish GitHub release ``` -------------------------------- ### Running Project Tests Source: https://github.com/teamwork/node-auto-launch/blob/master/CONTRIBUTING.md Command to execute the project's test suite. Compilation is not required before running tests. ```bash npm test ``` -------------------------------- ### Project Compilation Command Source: https://github.com/teamwork/node-auto-launch/blob/master/CONTRIBUTING.md The command to compile the project's CoffeeScript code using Gulp. ```bash gulp ``` -------------------------------- ### Windows App Store Compatibility Source: https://github.com/teamwork/node-auto-launch/blob/master/README.md For Electron apps in the Windows Store, direct executable linking is not possible due to sandboxing. A workaround involves using a specific path format: explorer.exe shell:AppsFolder\DEV_ID.APP_ID!PACKAGE_NAME. This requires knowing the app's developer ID, app ID, and package name. ```javascript new autoLaunch({ name: 'APP_NAME', path: "explorer.exe shell:AppsFolder\DEV_ID.APP_ID!PACKAGE_NAME" }) ``` -------------------------------- ### Windows Registry Configuration Source: https://github.com/teamwork/node-auto-launch/blob/master/README.md On Windows, auto-launching is configured by adding a registry entry under HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run. This method is generally compatible with uninstallers to manage the registry entry. ```javascript new autoLaunch({ name: 'YourAppName' }); ``` -------------------------------- ### macOS Launch Agent Configuration Source: https://github.com/teamwork/node-auto-launch/blob/master/README.md This method utilizes macOS Launch Agents by creating a .plist file in the user's Library/LaunchAgents directory. It's suitable for daemons or applications without a UI. Note that this method is not Mac App Store friendly and will lead to rejection if used within a sandboxed app. ```javascript new autoLaunch({ name: 'APP_NAME', path: "DEV_ID.APP_ID!PACKAGE_NAME", isHidden: true }) ``` -------------------------------- ### AutoLaunch API Source: https://github.com/teamwork/node-auto-launch/blob/master/README.md The node-auto-launch package provides a simple API to manage application auto-launching across different platforms. It allows enabling, disabling, and checking the status of auto-launching. ```APIDOC AutoLaunch Class: __constructor(options) options: Object name: String - The name of the application. path: String - The path to the application executable. Defaults to process.execPath. isHidden: Boolean - Whether to hide the application when it launches. Defaults to false. mac: Object - Platform-specific options for macOS. useLaunchAgent: Boolean - Whether to use Launch Agents on macOS. Defaults to true. windows: Object - Platform-specific options for Windows. useRegistry: Boolean - Whether to use registry entries on Windows. Defaults to true. enable(): Promise Enables auto-launching for the application. disable(): Promise Disables auto-launching for the application. isEnabled(): Promise Checks if auto-launching is currently enabled for the application. init(): Promise Initializes the auto-launching configuration. This is called automatically by the constructor but can be called manually if needed. ``` -------------------------------- ### Squirrel.Windows Integration Source: https://github.com/teamwork/node-auto-launch/blob/master/README.md When using Squirrel.Windows with Electron's autoUpdater on Windows, the registry entry points to Update.exe instead of the application executable. This ensures the correct version is launched after system restarts or updates. ```javascript new autoLaunch({ name: 'YourAppName', path: 'path/to/YourApp/Update.exe' }); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.