Open
Description
Preflight Checklist
- I have read the [contribution documentation](https://github.com/electron/electron-packager/blob/main/CONTRIBUTING.md) for this project.
- I agree to follow the [code of conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project follows, as appropriate.
- I have searched the issue tracker for a bug that matches the one I want to file, without success.
Issue Details
- Electron Packager Version:
- 15.5.1
- Electron Version:
- 17.1.0
- Operating System:
- Windows 10 (21H2)
Behavior
I'm trying to add a feature to my Electron application to make it automatically run after my computer starting up. And this is my source code:
ipcMain.on('EXCHANGE_OPEN_AT_LOGIN', (evt, openAtLogin) => {
if (app.isPackaged) {
app.setLoginItemSettings({
openAtLogin,
});
}
});
If I packaged my application with command like this , my application can be successfully self-booted.
electron-packager ./build SduMeeting --platform=win32 --arch=x64 --out ./dist --asar --overwrite
However, to implement certain features, I have to package it with command like this to get administrator privileges.
electron-packager ./build SduMeeting --platform=win32 --arch=x64 --out ./dist --asar --overwrite --win32metadata.requested-execution-level=requireAdministrator
The application packaged in this way cannot be opened automatically.
Additional Information
Excuse me, I'm a college student from a university in China with poor English. I wish my poor presentation wouldn't cause troubles for you.