
Dbg:$Desktop
By: a guest on
Jan 6th, 2012 | syntax:
NullSoft Installer | size: 1.58 KB | hits: 118 | expires: Never
outfile "$%temp%\nsistest.exe"
requestexecutionlevel user
showinstdetails show
completedtext "Done (NSIS ${NSIS_VERSION}, Win $9)"
!include LogicLib.nsh
!include WinVer.nsh
!ifndef CSIDL_DESKTOP
!define CSIDL_DESKTOP 0
!endif
!ifndef KF_FLAG_DONT_VERIFY
!define KF_FLAG_DONT_VERIFY 0x00004000
!endif
!macro DumpCSIDL dll csidl
DetailPrint ${dll}
!if "${dll}" != "shfolder"
System::Call 'shell32::SHGetSpecialFolderLocation(i$hwndparent,i${csidl},*i.r2)'
System::Call 'shell32::SHGetPathFromIDList(i r2,t.r1)'
System::Call 'Ole32::CoTaskMemFree(i r2)'
DetailPrint SHGetSpecialFolderLocation=$1
System::Call 'shell32::SHGetSpecialFolderPathA(i$hwndparent,m.r1,i${csidl},i0)'
DetailPrint SHGetSpecialFolderPathA=$1
System::Call 'shell32::SHGetSpecialFolderPathW(i$hwndparent,w.r1,i${csidl},i0)'
DetailPrint SHGetSpecialFolderPathW=$1
!endif
System::Call '${dll}::SHGetFolderPathA(i$hwndparent,i${csidl},i0,i0,m.r1)'
DetailPrint SHGetFolderPathA=$1
System::Call '${dll}::SHGetFolderPathW(i$hwndparent,i${csidl},i0,i0,w.r1)'
DetailPrint SHGetFolderPathW=$1
!macroend
Section
Detailprint $$Desktop=$Desktop
!insertmacro DumpCSIDL shfolder ${CSIDL_DESKTOP}
!insertmacro DumpCSIDL shell32 ${CSIDL_DESKTOP}
System::Call 'shell32::SHGetKnownFolderPath(g "{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}",i${KF_FLAG_DONT_VERIFY},i0,*w.r1)' ;leaking this mem
DetailPrint SHGetKnownFolderPath=$1
${WinVerGetMajor} $1
${WinVerGetMinor} $2
${WinVerGetBuild} $3
${WinVerGetServicePackLevel} $4
System::Call 'kernel32::IsWow64Process(i-1,*i 0 r5)'
StrCpy $9 "$1.$2.$3 SP=$4 IsWow64=$5"
SectionEnd