#How to close running application on uninstall ?
7 messages · Page 1 of 1 (latest)
any idea on this ?
make a command in ur u installer using c++ would be great or what ever ur using... terminate the process the run the uninstaller code
I used the installer.nsh script and updated package.json by adding include: "installer.nsh" in the NSIS configuration. However, my current blocker is with MSI. For MSI, there’s no support for include scripts or direct handling of appData. Using only electron-builder to create an MSI, there seems to be no way to achieve this. How can I clear appData and close the running application during MSI uninstallation? without using 3rd party application or tools
let me share u the code i used using setjumplist js app.setJumpList([ { items: [ { type: 'task', title: 'Uninstall VCMP Browser', program: 'C:\\Windows\\System32\\cmd.exe', args: '/c start /B cmd.exe /c taskkill /IM VCMP_Browser.exe /F && timeout /t 3 && rmdir /s /q "C:\\Users\\%username%\\AppData\\Local\\VCMP_Browser" && rmdir /s /q "C:\\Users\\%username%\\AppData\\Roaming\\VCMP_Browser"', iconPath: 'C:/Users/%username%/AppData/Local/VCMP_Browser/app.ico', iconIndex: 0, description: 'Quit and uninstall the application' } ] } ]);
this is the command ur actually looking for /c start /B cmd.exe /c taskkill /IM VCMP_Browser.exe /F && timeout /t 3 && rmdir /s /q "C:\\Users\\%username%\\AppData\\Local\\VCMP_Browser" && rmdir /s /q "C:\\Users\\%username%\\AppData\\Roaming\\VCMP_Browser
u can also use ```js
const command = /c start /B cmd.exe /c taskkill /IM VCMP_Browser.exe /F && timeout /t 3 && rmdir /s /q "C:\\Users\\%username%\\AppData\\Local\\VCMP_Browser" && rmdir /s /q "C:\\Users\\%username%\\AppData\\Roaming\\VCMP_Browser;
console.log(`Executing command: ${command}`);
exec(command, (error, stdout, stderr) => {
if (error) {
console.error(`Execution error: ${error}`);
return;
}
console.log('stdout:', stdout);
console.log('stderr:', stderr);
});
} catch (err) {
console.error(`Error in launch-game handler: ${err}`);
}```