[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'