Guest User

Untitled

a guest
May 17th, 2018
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. outfile "$%temp%\nsistest.exe"
  2. requestexecutionlevel user
  3. showinstdetails show
  4. completedtext "Done (NSIS ${NSIS_VERSION}, Win $9)"
  5. !include LogicLib.nsh
  6. !include WinVer.nsh
  7. !ifndef CSIDL_DESKTOP
  8. !define CSIDL_DESKTOP 0
  9. !endif
  10. !ifndef KF_FLAG_DONT_VERIFY
  11. !define KF_FLAG_DONT_VERIFY 0x00004000
  12. !endif
  13.  
  14. !macro DumpCSIDL dll csidl
  15. DetailPrint ${dll}
  16. !if "${dll}" != "shfolder"
  17. System::Call 'shell32::SHGetSpecialFolderLocation(i$hwndparent,i${csidl},*i.r2)'
  18. System::Call 'shell32::SHGetPathFromIDList(i r2,t.r1)'
  19. System::Call 'Ole32::CoTaskMemFree(i r2)'
  20. DetailPrint SHGetSpecialFolderLocation=$1
  21. System::Call 'shell32::SHGetSpecialFolderPathA(i$hwndparent,m.r1,i${csidl},i0)'
  22. DetailPrint SHGetSpecialFolderPathA=$1
  23. System::Call 'shell32::SHGetSpecialFolderPathW(i$hwndparent,w.r1,i${csidl},i0)'
  24. DetailPrint SHGetSpecialFolderPathW=$1
  25. !endif
  26. System::Call '${dll}::SHGetFolderPathA(i$hwndparent,i${csidl},i0,i0,m.r1)'
  27. DetailPrint SHGetFolderPathA=$1
  28. System::Call '${dll}::SHGetFolderPathW(i$hwndparent,i${csidl},i0,i0,w.r1)'
  29. DetailPrint SHGetFolderPathW=$1
  30. !macroend
  31.  
  32. Section
  33. Detailprint $$Desktop=$Desktop
  34. !insertmacro DumpCSIDL shfolder ${CSIDL_DESKTOP}
  35. !insertmacro DumpCSIDL shell32 ${CSIDL_DESKTOP}
  36. System::Call 'shell32::SHGetKnownFolderPath(g "{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}",i${KF_FLAG_DONT_VERIFY},i0,*w.r1)' ;leaking this mem
  37. DetailPrint SHGetKnownFolderPath=$1
  38.  
  39. ${WinVerGetMajor} $1
  40. ${WinVerGetMinor} $2
  41. ${WinVerGetBuild} $3
  42. ${WinVerGetServicePackLevel} $4
  43. StrCpy $9 "$1.$2.$3 SP=$4"
  44. SectionEnd
Add Comment
Please, Sign In to add comment