提交 f9df13d0 编写于 作者: C Corey Butler

Automatically use prior node.js install if desired. Closes #6.

上级 7fd9cac8
...@@ -34,6 +34,8 @@ SolidCompression=yes ...@@ -34,6 +34,8 @@ SolidCompression=yes
ChangesEnvironment=yes ChangesEnvironment=yes
DisableProgramGroupPage=yes DisableProgramGroupPage=yes
ArchitecturesInstallIn64BitMode=x64 ia64 ArchitecturesInstallIn64BitMode=x64 ia64
UninstallDisplayIcon={app}\{#MyIcon}
AppCopyright=Copyright (C) 2014 Corey Butler.
[Languages] [Languages]
Name: "english"; MessagesFile: "compiler:Default.isl" Name: "english"; MessagesFile: "compiler:Default.isl"
...@@ -72,6 +74,8 @@ begin ...@@ -72,6 +74,8 @@ begin
end; end;
//function getInstalledVErsions(dir: string): //function getInstalledVErsions(dir: string):
var
nodeInUse: string;
function TakeControl(np: string; nv: string): string; function TakeControl(np: string; nv: string): string;
var var
...@@ -99,6 +103,8 @@ begin ...@@ -99,6 +103,8 @@ begin
StringChangeEx(path,np+';;',';',True); StringChangeEx(path,np+';;',';',True);
RegWriteExpandStringValue(HKEY_CURRENT_USER, 'Environment', 'Path', path); RegWriteExpandStringValue(HKEY_CURRENT_USER, 'Environment', 'Path', path);
nodeInUse := ExpandConstant('{app}')+'\'+nv;
end; end;
...@@ -288,9 +294,19 @@ begin ...@@ -288,9 +294,19 @@ begin
Result := SymlinkPage.Values[0]; Result := SymlinkPage.Values[0];
end; end;
function getCurrentVersion(o: string): string;
begin
Result := nodeInUse;
end;
function isNodeAlreadyInUse(): boolean;
begin
Result := Length(nodeInUse) > 0;
end;
[Run] [Run]
Filename: "{cmd}"; Parameters: "/C {code:getSymLink}"; Flags: runhidden; Filename: "{cmd}"; Parameters: "/C ""mklink /D ""{code:getSymLink}"" ""{code:getCurrentVersion}"""" "; Check: isNodeAlreadyInUse; Flags: runhidden;
//Filename: "{cmd}"; Parameters: "/K nvm"; Flags: runasoriginaluser postinstall; Filename: "{cmd}"; Parameters: "/K ""set PATH={app};%PATH% && cls && nvm"""; Flags: runasoriginaluser postinstall;
[UninstallDelete] [UninstallDelete]
Type: files; Name: "{app}\nvm.exe"; Type: files; Name: "{app}\nvm.exe";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册