本文整理汇总了TypeScript中winreg.get函数的典型用法代码示例。如果您正苦于以下问题:TypeScript get函数的具体用法?TypeScript get怎么用?TypeScript get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: isDotNet40Installed
export function isDotNet40Installed(message: string) : IFuture<boolean> {
var result = new Future<boolean>();
var Winreg = require("winreg");
var regKey = new Winreg({
hive: Winreg.HKLM,
key: '\\Software\\Microsoft\\NET Framework Setup\\NDP\\v4\\Client'
});
regKey.get("Version", (err: Error, value: string) => {
if (err) {
this.$errors.fail({ formatStr: message, suppressCommandHelp: true });
}
result.return(true);
});
return result;
}
示例2: getMSDeployInstallPath
function getMSDeployInstallPath(registryKey: string): Q.Promise<string> {
var defer = Q.defer<string>();
var regKey = new winreg({
hive: winreg.HKLM,
key: registryKey
})
regKey.get("InstallPath", function(err,item) {
if(err) {
defer.reject(tl.loc("UnabletofindthelocationofMSDeployfromregistryonmachineError", err));
}
defer.resolve(item.value);
});
return defer.promise;
}
示例3: Winreg
docPromise.then(function(didSave) {
var docFilename = doc.fileName;
if (!didSave) {
vscode.window.showInformationMessage('Error saving file');
}
var regKey = new Winreg({
hive: Winreg.HKLM,
key: "\\Software\\Wow6432Node\\Microsoft\\VisualStudio\\" + version
});
// TODO: Look up different folder for non-64 bit
regKey.get("InstallDir", function(err, result) {
var devenvPath = result.value + "devenv.exe";
var cp = require("child_process");
cp.execFile(devenvPath, ["/edit", docFilename]);
});
});
示例4: _getToolInstalledPathFromRegKey
/**
* Get installed path from registry key
* @param registryKey window registry key
*
* @returns installed path
*/
private _getToolInstalledPathFromRegKey(registryKey: string): Q.Promise<string> {
var defer = Q.defer<string>();
var regKey = new winreg({
hive: winreg.HKLM,
key: registryKey
});
regKey.get("Location", function(err,item) {
if(err) {
task.debug('Error during fetching installed path from registry key: '+ err);
defer.reject(new Error(task.loc("UnableToFindTheLocationOfMysqlFromRegistryOnMachineError", err)));
}else{
task.debug('Window mysql installed path from registry key: '+ item.value);
defer.resolve(item.value);
}
});
return defer.promise;
}