12345678910111213141516171819202122232425262728293031323334 |
- module.exports = {
- verifyAndInstall(){
- return getTaskCheckExists(this.shellcmd, { ignorefailures: true })().then((exists) => {
- if(exists) {
-
- return this.postinstallsteps.bind(this)()
- }
- return this.install();
- });
- },
-
- acquireElevationState(__isElevated) {
- if (__isElevated === null) {
- return nodeShellExec("fsutil", ["dirty", "query", "C:"], {
- inherit: true
-
- , stdio: 'ignore'
- , env: process.env
- , title: `check privileged execution mode using "fsutil dirty query C:"`
- }).then((exitcode) => {
- console.log('Elevated')
- __isElevated = true;
- return true;
- }).catch(() => {
- __isElevated = false;
- console.log('Not Elevated');
- return false;
- });
- }
- else return Promise.resolve(__isElevated);
- },
-
- }
|