{I+=codeWee;}
[NSIS] NSIS : How to install PM2 for Node.js by npm
!include x64.nsh

Unicode true

; install

	${If} ${RunningX64}
	SetRegView 64
		ReadRegStr $NodeJSPath HKLM "SOFTWARE\Node.js" "InstallPath"
	SetRegView LastUsed
	${Else}
		ReadRegStr $NodeJSPath HKLM "SOFTWARE\Node.js" "InstallPath"
	${EndIf}

	ExecWait 'cmd /c "$NodeJSPath\npm" install pm2 -g'


; uninstall

	${If} ${RunningX64}
	SetRegView 64
		ReadRegStr $NodeJSPath HKLM "SOFTWARE\Node.js" "InstallPath"
	SetRegView LastUsed
	${Else}
		ReadRegStr $NodeJSPath HKLM "SOFTWARE\Node.js" "InstallPath"
	${EndIf}
	
	ExecWait 'cmd /c "$NodeJSPath\npm" uninstall pm2 -g'
HTML | PHP | C++ | DirectX11 | Javascript | C# | HTML5 | ASP | SQL | General | CSS | Oculus Rift | Unity3d | Virtools SDK | Tip | NSIS | PowerShell | node.js | Web API | RTSP | All
Copyright© 2016 CodeWee.com All rights reserved.