Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async _hasWindowsMedia() {
if (!is.windows) {
return true
}
const version = this.os.release
if (toInteger(version) < 10) {
// no windows 10
return true
}
if (!is.development) {
// regedit commands
regedit.setExternalVBSLocation(
getAppResourcesPath('vbs'),
)
}
const value = await new Promise((resolve) => {
const regKey = 'HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Setup\\WindowsFeatures'
regedit.list(regKey, (err, result) => {
if (!isNil(err)) {
resolve(false)
return
}
resolve(result[regKey].keys.includes('WindowsMediaVersion'))
})
})
hasWindowsMedia() {
if (is.windows && !is.development) {
regedit.setExternalVBSLocation(
paths.getGuiResources('vbs'),
)
}
return new Promise((resolve) => {
if (!is.windows) {
resolve(true)
return
}
const regKey = 'HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Setup\\WindowsFeatures'
regedit.list(regKey, (err, result) => {
if (!_.isNil(err)) {
resolve(false)
return
export const hasWindowsMedia = () => {
if (is.windows && !is.development) {
regedit.setExternalVBSLocation(
getAppResourcesPath('vbs'),
)
}
return new Promise((resolve) => {
if (!is.windows) {
resolve(true)
return
}
const regKey = 'HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Setup\\WindowsFeatures'
regedit.list(regKey, (err, result) => {
if (!isNil(err)) {
resolve(false)
return