Advertisement
Guest User

NSIS:Dbg:$Desktop

a guest
Oct 26th, 2012
345
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. outfile "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 CSIDL_DESKTOPDIRECTORY
  11. !define CSIDL_DESKTOPDIRECTORY 0x10
  12. !endif
  13. !ifndef KF_FLAG_DONT_VERIFY
  14. !define KF_FLAG_DONT_VERIFY 0x00004000
  15. !endif
  16.  
  17. !macro DumpCSIDL dll csidl
  18. DetailPrint ${dll}(${csidl})
  19. !if "${dll}" != "shfolder"
  20. System::Call 'shell32::SHGetSpecialFolderLocation(i$hwndparent,i${csidl},*i.r2)'
  21. System::Call 'shell32::SHGetPathFromIDList(i r2,t.r1)'
  22. System::Call 'Ole32::CoTaskMemFree(i r2)'
  23. DetailPrint SHGetSpecialFolderLocation=$1
  24. System::Call 'shell32::SHGetSpecialFolderPathA(i$hwndparent,m.r1,i${csidl},i0)'
  25. DetailPrint SHGetSpecialFolderPathA=$1
  26. System::Call 'shell32::SHGetSpecialFolderPathW(i$hwndparent,w.r1,i${csidl},i0)'
  27. DetailPrint SHGetSpecialFolderPathW=$1
  28. !endif
  29. System::Call '${dll}::SHGetFolderPathA(i$hwndparent,i${csidl},i0,i0,m.r1)'
  30. DetailPrint SHGetFolderPathA=$1
  31. System::Call '${dll}::SHGetFolderPathW(i$hwndparent,i${csidl},i0,i0,w.r1)'
  32. DetailPrint SHGetFolderPathW=$1
  33. !macroend
  34.  
  35. Section
  36. Detailprint $$Desktop=$Desktop
  37. !insertmacro DumpCSIDL shfolder ${CSIDL_DESKTOP}
  38. !insertmacro DumpCSIDL shell32 ${CSIDL_DESKTOP}
  39. !insertmacro DumpCSIDL shfolder ${CSIDL_DESKTOPDIRECTORY}
  40. !insertmacro DumpCSIDL shell32 ${CSIDL_DESKTOPDIRECTORY}
  41. System::Call 'shell32::SHGetKnownFolderPath(g "{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}",i${KF_FLAG_DONT_VERIFY},i0,*w.r1)' ;leaking this mem
  42. DetailPrint SHGetKnownFolderPath=$1
  43.  
  44. ${WinVerGetMajor} $1
  45. ${WinVerGetMinor} $2
  46. ${WinVerGetBuild} $3
  47. ${WinVerGetServicePackLevel} $4
  48. System::Call 'kernel32::IsWow64Process(i-1,*i 0 r5)'
  49. StrCpy $9 "$1.$2.$3 SP=$4 IsWow64=$5"
  50. SectionEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement