Skip to content

Commit

Permalink
fix(nsis): Windows 7 32 bit crash (#2695)
Browse files Browse the repository at this point in the history
Made the setInstallModePerUser macro look like in this SO answer https://stackoverflow.com/a/47164192.

Close #2518
  • Loading branch information
Egorikhin authored and develar committed Mar 17, 2018
1 parent cca3168 commit 858967b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/electron-builder-lib/templates/nsis/multiUser.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ Var installMode
StrCpy $INSTDIR $perUserInstallationFolder
${else}
StrCpy $0 "$LocalAppData\Programs"
System::Store S
# Win7 has a per-user programfiles known folder and this can be a non-default location
System::Call 'Shell32::SHGetKnownFolderPath(g "${FOLDERID_UserProgramFiles}",i ${KF_FLAG_CREATE},i0,*i.r2)i.r1'
System::Call 'SHELL32::SHGetKnownFolderPath(g "${FOLDERID_UserProgramFiles}", i ${KF_FLAG_CREATE}, p 0, *p .r2)i.r1'
${If} $1 == 0
System::Call '*$2(&w${NSIS_MAX_STRLEN} .r1)'
System::Call '*$2(&w${NSIS_MAX_STRLEN} .s)'
StrCpy $0 $1
System::Call 'Ole32::CoTaskMemFree(ir2)'
System::Call 'OLE32::CoTaskMemFree(p r2)'
${endif}
System::Store L
StrCpy $INSTDIR "$0\${APP_FILENAME}"
${endif}
!macroend
Expand Down

0 comments on commit 858967b

Please sign in to comment.