本文整理匯總了TypeScript中regedit.list函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript list函數的具體用法?TypeScript list怎麽用?TypeScript list使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了list函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: isDontShowUIRegKeySet
export function isDontShowUIRegKeySet(regPath: string): Q.Promise<boolean> {
const defer = Q.defer<boolean>();
const regValue = 'DontShowUI';
regedit.list(regPath).on('data', (entry) => {
if (entry && entry.data && entry.data.values &&
entry.data.values[regValue] && (entry.data.values[regValue].value === 1)) {
defer.resolve(true);
}
defer.resolve(false);
});
return defer.promise;
}
示例2: getMSDeployInstallPath
function getMSDeployInstallPath(registryKey: string): Q.Promise<string> {
var defer = Q.defer<string>();
regedit.list(registryKey)
.on('data', (entry) => {
defer.resolve(entry.data.values.InstallPath.value);
})
.on('error', (error) => {
defer.reject(tl.loc("UnabletofindthelocationofMSDeployfromregistryonmachineError", error));
});
return defer.promise;
}
示例3: getMSDeployVersion
function getMSDeployVersion(registryKey: string): Q.Promise<String> {
var defer = Q.defer<String>();
regedit.list(registryKey)
.on('data', (entry) => {
var keys = entry.data.keys;
keys.sort();
if(parseFloat(keys[keys.length-1]) < 3) {
defer.reject(tl.loc("UnsupportedinstalledversionfoundforMSDeployversionshouldbealteast3orabove", keys[keys.length-1]));
}
defer.resolve(keys[keys.length-1]);
})
.on('error', (error) => {
defer.reject(tl.loc("UnabletofindthelocationofMSDeployfromregistryonmachineError", error));
});
return defer.promise;
}
示例4: locateVSVersion
function locateVSVersion(): Q.Promise<number> {
var defer = Q.defer<number>();
var vsVersion = parseFloat(vsTestVersion);
if (!isNaN(vsVersion)) {
defer.resolve(vsVersion);
return defer.promise;
}
var regPath = "HKLM\\SOFTWARE\\Microsoft\\VisualStudio";
regedit.list(regPath).on('data', function (entry) {
if (entry && entry.data && entry.data.keys) {
var subkeys = entry.data.keys;
var versions = getFloatsFromStringArray(subkeys);
if (versions && versions.length > 0) {
versions.sort((a, b) => a - b);
defer.resolve(versions[versions.length - 1]);
return defer.promise;
}
}
defer.resolve(null);
});
return defer.promise;
}
示例5: getLatestVSTestConsolePathFromRegistry
function getLatestVSTestConsolePathFromRegistry(): Promise<string> {
let deferred = Q.defer<string>();
let regPath = 'HKLM\\SOFTWARE\\Microsoft\\VisualStudio';
regedit.list(regPath).on('data', (entry) => {
let subkeys = entry.data.keys;
let versions = getFloatsFromStringArray(subkeys);
if (versions && versions.length > 0) {
versions.sort((a, b) => a - b);
let selectedVersion = versions[versions.length - 1];
tl.debug('Registry entry found. Selected version is ' + selectedVersion.toString());
return Promise.resolve(getVSTestLocation(selectedVersion));
}
tl.debug('No Registry entry found under VisualStudio node');
return Promise.resolve(null);
}).on('error', () => {
tl.debug('Registry entry not found under VisualStudio node');
return Promise.resolve(null);
});
return Promise.resolve(null);
}