!define APP_NAME "wincap11" Name ${APP_NAME} OutFile "${APP_NAME}-setup.exe" InstallDir $PROGRAMFILES\${APP_NAME} ; Store the install dir in the registry to use when updating InstallDirRegKey HKLM "Software\${APP_NAME}" "InstallDir" RequestExecutionLevel user ;################################## ; Pages Page components Page directory Page instfiles UninstPage uninstConfirm UninstPage instfiles ;################################## ; Install Section "${APP_NAME} (required)" SectionIn RO SetOutPath $INSTDIR ; App Files File /r "cmake-build-release\bin\*" ; Write the installation path into the registry WriteRegStr HKLM SOFTWARE\${APP_NAME} "InstallDir" "$INSTDIR" ; Write the uninstall keys for Windows WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YOURPROGRAM" "DisplayName" "${APP_NAME}" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YOURPROGRAM" "UninstallString" '"$INSTDIR\uninstall.exe"' WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YOURPROGRAM" "NoModify" 1 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YOURPROGRAM" "NoRepair" 1 WriteUninstaller "$INSTDIR\uninstall.exe" SectionEnd ; Optional section (can be disabled by the user) Section "Start Menu Shortcuts" SectionIn RO CreateDirectory "$SMPROGRAMS\${APP_NAME}" CreateShortcut "$SMPROGRAMS\${APP_NAME}\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 CreateShortcut "$SMPROGRAMS\${APP_NAME}\${APP_NAME}.lnk" "$INSTDIR\${APP_NAME}.exe" "" "$INSTDIR\${APP_NAME}.exe" 0 SectionEnd ;################################## ; Uninstall Section "Uninstall" ; Remove registry keys DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" DeleteRegKey HKLM SOFTWARE\${APP_NAME} ; Remove shortcuts Delete "$SMPROGRAMS\${APP_NAME}\*.*" ; Remove install dir RMDir "$SMPROGRAMS\${APP_NAME}" RMDir /r "$INSTDIR" SectionEnd