Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
风弥漫了夏天
nvm-windows
提交
87356a44
N
nvm-windows
项目概览
风弥漫了夏天
/
nvm-windows
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
nvm-windows
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
87356a44
编写于
10月 15, 2014
作者:
C
Corey Butler
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Now using goxc for build process.
上级
af6827bc
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
49 addition
and
24 deletion
+49
-24
build.bat
build.bat
+32
-7
nvm.iss
nvm.iss
+17
-17
未找到文件。
build.bat
浏览文件 @
87356a44
@echo
off
SET
INNOSETUP
=
%CD%
\nvm.iss
SET
ORIG
=
%CD%
SET
GOPATH
=
%CD%
\src
SET
GOBIN
=
%CD%
\bin
SET
GOARCH
=
386
REM Get the version number from the setup file
for
/f
"tokens=*"
%%i
in
(
'findstr /n .
%INNOSETUP%
^|
findstr
^4
:#define'
)
do
set
L
=
%%i
set
version
=
%L
:
~
24
,-
1
%
REM Get the version number from the core executable
for
/f
"tokens=*"
%%i
in
(
'findstr /n .
%GOPATH%
\nvm.go
^|
findstr
^N
vmVersion
^|
findstr
^2
1
^'
) do set L=
%%i
set goversion=
%L
:~19,-1
%
IF NOT
%version%
==
%goversion%
GOTO VERSIONMISMATCH
SET DIST=
%CD%
\dist\
%version%
REM Build the executable
echo Building NVM for Windows
SET
DIST
=
%CD%
\dist\
%version%
SET
GOPATH
=
%CD%
\src
SET
GOBIN
=
%CD%
\bin
SET
GOARCH
=
386
go
build
-o
%GOBIN%
\nvm.exe
%GOPATH%
\nvm.go
rm
%GOBIN%
\nvm.exe
cd
%GOPATH%
goxc -arch="386" -os="windows" -n="nvm" -d="
%GOBIN%
" -o="
%GOBIN%
\nvm{{.Ext}}" -tasks-=package
cd
%ORIG%
rm
%GOBIN%
\src.exe
rm
%GOPATH%
\src.exe
rm
%GOPATH%
\nvm.exe
REM Clean the dist directory
rm -rf "
%DIST%
"
mkdir "
%DIST%
"
REM Create the "noinstall" zip
echo Generating nvm-noinstall.zip
...
...
@@ -22,8 +40,15 @@ echo Generating nvm-setup.zip
buildtools\iscc
%INNOSETUP%
/o
%DIST%
buildtools\zip -j -9 -r "
%DIST%
\nvm-setup.zip" "
%DIST%
\nvm-setup.exe"
rm "
%DIST%
\nvm-setup.exe"
cls
echo --------------------------
echo Release
%version%
available in
%DIST%
GOTO COMPLETE
:VERSIONMISMATCH
echo The version number in nvm.iss does not match the version in src\nvm.go
echo - nvm.iss line #4:
%version%
echo - nvm.go line #21:
%goversion%
EXIT /B
:COMPLETE
@echo on
nvm.iss
浏览文件 @
87356a44
#define MyAppName "NVM for Windows"
#define MyAppShortName "nvm"
#define MyAppLCShortName "nvm"
#define MyAppVersion "1.0.
4
"
#define MyAppVersion "1.0.
5
"
#define MyAppPublisher "Ecor Ventures, LLC"
#define MyAppURL "http://github.com/coreybutler/nvm"
#define MyAppExeName "nvm.exe"
...
...
@@ -55,7 +55,7 @@ var
SymlinkPage: TInputDirWizardPage;
function IsDirEmpty(dir: string): Boolean;
var
var
FindRec: TFindRec;
ct: Integer;
begin
...
...
@@ -73,8 +73,8 @@ begin
end;
end;
//function getInstalledVErsions(dir: string):
var
//function getInstalledVErsions(dir: string):
var
nodeInUse: string;
function TakeControl(np: string; nv: string): string;
...
...
@@ -93,7 +93,7 @@ begin
StringChangeEx(path,np+';;',';',True);
RegWriteExpandStringValue(HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment', 'Path', path);
RegQueryStringValue(HKEY_CURRENT_USER,
'Environment',
'Path', path);
...
...
@@ -105,7 +105,7 @@ begin
RegWriteExpandStringValue(HKEY_CURRENT_USER, 'Environment', 'Path', path);
nodeInUse := ExpandConstant('{app}')+'\'+nv;
end;
function Ansi2String(AString:AnsiString):String;
...
...
@@ -134,7 +134,7 @@ begin
// Create a file to check for Node.JS
TmpJS := ExpandConstant('{tmp}') + '\nvm_check.js';
SaveStringToFile(TmpJS, 'console.log(require("path").dirname(process.execPath));', False);
// Execute the node file and save the output temporarily
TmpResultFile := ExpandConstant('{tmp}') + '\nvm_node_check.txt';
Exec(ExpandConstant('{cmd}'), '/C node "'+TmpJS+'" > "' + TmpResultFile + '"', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
...
...
@@ -163,7 +163,7 @@ begin
TakeControl(NodePath, NodeVersion);
end;
end;
// Make sure the symlink directory doesn't exist
if DirExists(SymlinkPage.Values[0]) then begin
// If the directory is empty, just delete it since it will be recreated anyway.
...
...
@@ -200,14 +200,14 @@ var
nvm_symlink: string;
begin
MsgBox('Removing NVM for Windows will remove the nvm command and all versions of node.js, including global npm modules.', mbInformation, MB_OK);
// Remove the symlink
RegQueryStringValue(HKEY_LOCAL_MACHINE,
'SYSTEM\CurrentControlSet\Control\Session Manager\Environment',
'NVM_SYMLINK', nvm_symlink);
RemoveDir(nvm_symlink);
// Clean the registry
// Clean the registry
RegDeleteValue(HKEY_LOCAL_MACHINE,
'SYSTEM\CurrentControlSet\Control\Session Manager\Environment',
'NVM_HOME')
...
...
@@ -228,9 +228,9 @@ begin
StringChangeEx(path,'%NVM_HOME%','',True);
StringChangeEx(path,'%NVM_SYMLINK%','',True);
StringChangeEx(path,';;',';',True);
RegWriteExpandStringValue(HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment', 'Path', path);
RegQueryStringValue(HKEY_CURRENT_USER,
'Environment',
'Path', path);
...
...
@@ -238,9 +238,9 @@ begin
StringChangeEx(path,'%NVM_HOME%','',True);
StringChangeEx(path,'%NVM_SYMLINK%','',True);
StringChangeEx(path,';;',';',True);
RegWriteExpandStringValue(HKEY_CURRENT_USER, 'Environment', 'Path', path);
Result := True;
end;
...
...
@@ -249,7 +249,7 @@ procedure CurStepChanged(CurStep: TSetupStep);
var
path: string;
begin
if CurStep = ssPostInstall then
if CurStep = ssPostInstall then
begin
SaveStringToFile(ExpandConstant('{app}\settings.txt'), 'root: ' + ExpandConstant('{app}') + #13#10 + 'path: ' + SymlinkPage.Values[0] + #13#10, False);
...
...
@@ -314,4 +314,4 @@ Type: files; Name: "{app}\elevate.cmd";
Type: files; Name: "{app}\elevate.vbs";
Type: files; Name: "{app}\nodejs.ico";
Type: files; Name: "{app}\settings.txt";
Type: filesandordirs; Name: "{app}";
\ No newline at end of file
Type: filesandordirs; Name: "{app}";
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录