Advertisement
LockdateforGHS

Untitled

Apr 8th, 2023
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. ; Set the name and version of the installer
  2. Name "MyInstaller"
  3. OutFile "MyInstaller.exe"
  4. InstallDir "$PROGRAMFILES\MyProgram"
  5. InstallDirRegKey HKLM "Software\MyProgram" "InstallDir"
  6.  
  7. ; Set the default installation options
  8. RequestExecutionLevel admin
  9. AllowSkipFiles off
  10. AllowRootDirInstall off
  11.  
  12. ; Create the components and sections for the installer
  13. Section "Main Program" SEC_MAIN
  14. SetOutPath "$INSTDIR"
  15. File "MyProgram.exe"
  16. File "README.txt"
  17. SectionEnd
  18.  
  19. Section "Optional Files" SEC_OPTIONAL
  20. SetOutPath "$INSTDIR\Optional"
  21. File "OptionalFile1.txt"
  22. File "OptionalFile2.txt"
  23. SectionEnd
  24.  
  25. ; Add the installer pages and controls
  26. Page components
  27. Page directory
  28. Page instfiles
  29.  
  30. ; Define the installation finish page
  31. LangString FINISH_TEXT ${LANG_ENGLISH} "Installation complete! Click Finish to exit."
  32. LangString FINISH_SUBTEXT ${LANG_ENGLISH} "Thank you for installing MyProgram."
  33. !insertmacro MUI_FINISHPAGE_SHOW README $FINISH_TEXT $FINISH_SUBTEXT
  34.  
  35. ; Create the uninstaller for the installer
  36. Section "Uninstall"
  37. SetOutPath "$INSTDIR"
  38. Delete "$INSTDIR\MyProgram.exe"
  39. Delete "$INSTDIR\README.txt"
  40. RMDir "$INSTDIR\Optional"
  41. RMDir "$INSTDIR"
  42. SectionEnd
  43. This code creates an installer for a program called "MyProgram", with two components: the main program and some optional files. The installer creates a shortcut in the user's start menu and an entry in the add/remove programs list. It also creates an uninstaller for the program.
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement