UAC_GetUserShellFolderPath.nsi 725 B

123456789101112131415161718192021222324252627282930
  1. RequestExecutionLevel user /* RequestExecutionLevel REQUIRED! */
  2. !define APPNAME "UAC_GetUserShellFolderPath"
  3. Name "${APPNAME}"
  4. OutFile "${APPNAME}.exe"
  5. ShowInstDetails show
  6. !include UAC.nsh
  7. !include LogicLib.nsh
  8. page instfiles
  9. Function .onInit
  10. ${UAC.I.Elevate.AdminOnly}
  11. FunctionEnd
  12. !ifndef CSIDL_PERSONAL
  13. !define CSIDL_PERSONAL 0x0005 ;My Documents
  14. !endif
  15. Section
  16. /*
  17. You can specify a fallback value in the 2nd parameter, it is used if the installer is not elevated
  18. or running on NT4/Win9x or on errors.
  19. If you just want to check for success, use "" as the 2nd parameter and compare $0 with ""
  20. */
  21. UAC::GetShellFolderPath ${CSIDL_PERSONAL} $Documents
  22. DetailPrint MyDocs=$0
  23. SectionEnd