當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript winreg.get函數代碼示例

本文整理匯總了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;
}
開發者ID:cxfeng1,項目名稱:icenium-cli,代碼行數:15,代碼來源:host-info.ts

示例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;
}
開發者ID:colindembovsky,項目名稱:vsts-tasks,代碼行數:17,代碼來源:msdeployutility.ts

示例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]);
                });
            });
開發者ID:clintcparker,項目名稱:OpenInVS,代碼行數:19,代碼來源:extension.ts

示例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;
 }
開發者ID:Microsoft,項目名稱:vsts-tasks,代碼行數:25,代碼來源:ToolPathOperations.ts


注:本文中的winreg.get函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。