Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Set the name and version of the installer
- Name "MyInstaller"
- OutFile "MyInstaller.exe"
- InstallDir "$PROGRAMFILES\MyProgram"
- InstallDirRegKey HKLM "Software\MyProgram" "InstallDir"
- ; Set the default installation options
- RequestExecutionLevel admin
- AllowSkipFiles off
- AllowRootDirInstall off
- ; Create the components and sections for the installer
- Section "Main Program" SEC_MAIN
- SetOutPath "$INSTDIR"
- File "MyProgram.exe"
- File "README.txt"
- SectionEnd
- Section "Optional Files" SEC_OPTIONAL
- SetOutPath "$INSTDIR\Optional"
- File "OptionalFile1.txt"
- File "OptionalFile2.txt"
- SectionEnd
- ; Add the installer pages and controls
- Page components
- Page directory
- Page instfiles
- ; Define the installation finish page
- LangString FINISH_TEXT ${LANG_ENGLISH} "Installation complete! Click Finish to exit."
- LangString FINISH_SUBTEXT ${LANG_ENGLISH} "Thank you for installing MyProgram."
- !insertmacro MUI_FINISHPAGE_SHOW README $FINISH_TEXT $FINISH_SUBTEXT
- ; Create the uninstaller for the installer
- Section "Uninstall"
- SetOutPath "$INSTDIR"
- Delete "$INSTDIR\MyProgram.exe"
- Delete "$INSTDIR\README.txt"
- RMDir "$INSTDIR\Optional"
- RMDir "$INSTDIR"
- SectionEnd
- 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.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement