本文整理汇总了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);
}