Examples/ExperienceUI/Realworld.nsi
changeset 13 2ae1abe546fd
parent 0 d5ce4c64ef88
equal deleted inserted replaced
12:e1e0fe6c578e 13:2ae1abe546fd
    95 Page custom repair rpverify " "
    95 Page custom repair rpverify " "
    96 Page custom repaircomplete "" " "
    96 Page custom repaircomplete "" " "
    97 !define XPUI_PAGE_CUSTOMFUNCTION_SHOW WelSetTime
    97 !define XPUI_PAGE_CUSTOMFUNCTION_SHOW WelSetTime
    98 !insertmacro XPUI_PAGE_WELCOME
    98 !insertmacro XPUI_PAGE_WELCOME
    99 !define XPUI_PAGE_CUSTOMFUNCTION_SHOW LicSetTime
    99 !define XPUI_PAGE_CUSTOMFUNCTION_SHOW LicSetTime
   100 !insertmacro XPUI_PAGE_LICENSE "${NSISDIR}\Contrib\ExperienceUI\License.rtf"
   100 !insertmacro XPUI_PAGE_LICENSE "${XPUI_SYSDIR}\License.rtf"
   101 !define XPUI_PAGE_CUSTOMFUNCTION_SHOW CmpSetTime
   101 !define XPUI_PAGE_CUSTOMFUNCTION_SHOW CmpSetTime
   102 !insertmacro XPUI_PAGE_COMPONENTS
   102 !insertmacro XPUI_PAGE_COMPONENTS
   103 !define XPUI_PAGE_CUSTOMFUNCTION_SHOW DirSetTime
   103 !define XPUI_PAGE_CUSTOMFUNCTION_SHOW DirSetTime
   104 !insertmacro XPUI_PAGE_DIRECTORY
   104 !insertmacro XPUI_PAGE_DIRECTORY
   105 !define XPUI_PAGE_CUSTOMFUNCTION_SHOW ICSetTime
   105 !define XPUI_PAGE_CUSTOMFUNCTION_SHOW ICSetTime
   223 Var INSTALLING_README
   223 Var INSTALLING_README
   224 
   224 
   225 !macro INSTALL_BASEFILES
   225 !macro INSTALL_BASEFILES
   226 StrCpy $INSTALLING_README 0
   226 StrCpy $INSTALLING_README 0
   227 SetOutPath "$INSTDIR"
   227 SetOutPath "$INSTDIR"
   228 File Data\Notepad.exe
   228 File "$%SystemRoot%\System32\Notepad.exe"
   229 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayName "$(^Name)"
   229 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayName "$(^Name)"
   230 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString "$INSTDIR\Uninst.exe"
   230 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString "$INSTDIR\Uninst.exe"
   231 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" ModifyPath "$INSTDIR\Setup.exe"
   231 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" ModifyPath "$INSTDIR\Setup.exe"
   232 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayIcon "$INSTDIR\${EXECUTABLE}"
   232 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayIcon "$INSTDIR\${EXECUTABLE}"
   233 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" InstallDir "$INSTDIR"
   233 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" InstallDir "$INSTDIR"
   323 ShowWindow $0 1
   323 ShowWindow $0 1
   324 BringToFront
   324 BringToFront
   325 ReadRegStr $0 HKLM Software\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name) DisplayName
   325 ReadRegStr $0 HKLM Software\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name) DisplayName
   326 StrCmp $0 "" "" +2
   326 StrCmp $0 "" "" +2
   327 Abort
   327 Abort
   328 !insertmacro XPUI_INSTALLOPTIONS_EXTRACT_AS "${NSISDIR}\Contrib\ExperienceUI\INI\Repair.ini" "Repair.ini"
   328 !insertmacro XPUI_INSTALLOPTIONS_EXTRACT_AS "${XPUI_SYSDIR}\INI\Repair.ini" "Repair.ini"
   329 !insertmacro XPUI_HEADER_TEXT `Welcome to the $(^Name) Setup Wizard` `Select which maintenance action you wish to perform.`
   329 !insertmacro XPUI_HEADER_TEXT `Welcome to the $(^Name) Setup Wizard` `Select which maintenance action you wish to perform.`
   330 !insertmacro XPUI_INSTALLOPTIONS_INITDIALOG "Repair.ini"
   330 !insertmacro XPUI_INSTALLOPTIONS_INITDIALOG "Repair.ini"
   331 Pop $1
   331 Pop $1
   332 GetDlgItem $0 $1 1200
   332 GetDlgItem $0 $1 1200
   333 SendMessage $0 ${WM_SETTEXT} 0 "STR:Repair $(^Name)"
   333 SendMessage $0 ${WM_SETTEXT} 0 "STR:Repair $(^Name)"
   401 Sleep 500
   401 Sleep 500
   402 ExecWait $4\Uninst.exe
   402 ExecWait $4\Uninst.exe
   403 Banner::destroy
   403 Banner::destroy
   404 Quit
   404 Quit
   405 Repair:
   405 Repair:
   406 !insertmacro XPUI_INSTALLOPTIONS_EXTRACT_AS "${NSISDIR}\Contrib\ExperienceUI\INI\confirm_rep.ini" "confirm_rep.ini"
   406 !insertmacro XPUI_INSTALLOPTIONS_EXTRACT_AS "${XPUI_SYSDIR}\INI\confirm_rep.ini" "confirm_rep.ini"
   407 !insertmacro XPUI_INSTALLOPTIONS_WRITE Confirm_rep.ini "Settings" NextButtonText "Next"
   407 !insertmacro XPUI_INSTALLOPTIONS_WRITE Confirm_rep.ini "Settings" NextButtonText "Next"
   408 !insertmacro XPUI_INSTALLOPTIONS_WRITE Confirm_Rep.ini "Settings" BackEnabled 1
   408 !insertmacro XPUI_INSTALLOPTIONS_WRITE Confirm_Rep.ini "Settings" BackEnabled 1
   409 !insertmacro XPUI_INSTALLOPTIONS_WRITE Confirm_Rep.ini "Field 2" Text "Setup is ready to repair $(^Name)."
   409 !insertmacro XPUI_INSTALLOPTIONS_WRITE Confirm_Rep.ini "Field 2" Text "Setup is ready to repair $(^Name)."
   410 !insertmacro XPUI_INSTALLOPTIONS_WRITE Confirm_Rep.ini "Field 3" Text "Click 'Repair' to contunue."
   410 !insertmacro XPUI_INSTALLOPTIONS_WRITE Confirm_Rep.ini "Field 3" Text "Click 'Repair' to contunue."
   411 !insertmacro XPUI_INSTALLOPTIONS_WRITE Confirm_Rep.ini "Field 4" Top "-17"
   411 !insertmacro XPUI_INSTALLOPTIONS_WRITE Confirm_Rep.ini "Field 4" Top "-17"
   480 ShowWindow $HWNDPARENT 5
   480 ShowWindow $HWNDPARENT 5
   481 !ifmacrodef  XPUI_SET_BG
   481 !ifmacrodef  XPUI_SET_BG
   482 !insertmacro XPUI_SET_BG
   482 !insertmacro XPUI_SET_BG
   483 !endif
   483 !endif
   484 SetOutPath $PLUGINSDIR
   484 SetOutPath $PLUGINSDIR
   485 File "${NSISDIR}\Contrib\ExperienceUI\INI\Confirm.ini"
   485 File "${XPUI_SYSDIR}\INI\Confirm.ini"
   486 !insertmacro XPUI_HEADER_TEXT `Repair Complete` `Setup has successfully repaired your installation of $(^Name).`
   486 !insertmacro XPUI_HEADER_TEXT `Repair Complete` `Setup has successfully repaired your installation of $(^Name).`
   487 WriteINIStr $PLUGINSDIR\Confirm.ini "Settings" NextButtonText "Finish"
   487 WriteINIStr $PLUGINSDIR\Confirm.ini "Settings" NextButtonText "Finish"
   488 WriteINIStr $PLUGINSDIR\Confirm.ini "Settings" BackEnabled 0
   488 WriteINIStr $PLUGINSDIR\Confirm.ini "Settings" BackEnabled 0
   489 WriteINIStr $PLUGINSDIR\Confirm.ini "Field 1" Text "$(^Name) has been successfully repaired."
   489 WriteINIStr $PLUGINSDIR\Confirm.ini "Field 1" Text "$(^Name) has been successfully repaired."
   490 WriteINIStr $PLUGINSDIR\Confirm.ini "Field 2" Text "Click $\"Finish$\" to exit."
   490 WriteINIStr $PLUGINSDIR\Confirm.ini "Field 2" Text "Click $\"Finish$\" to exit."
   513 
   513 
   514 SetPluginUnload alwaysoff
   514 SetPluginUnload alwaysoff
   515 Function un.unsuccess
   515 Function un.unsuccess
   516 StrCmp $6 1 "" UninstGood
   516 StrCmp $6 1 "" UninstGood
   517 SetOutPath $PLUGINSDIR
   517 SetOutPath $PLUGINSDIR
   518 File "${NSISDIR}\Contrib\ExperienceUI\INI\confirm.ini"
   518 File "${XPUI_SYSDIR}\INI\confirm.ini"
   519 !insertmacro XPUI_HEADER_TEXT `Uninstall Incomplete` `Setup encountered a problem while uninstalling $(^Name).`
   519 !insertmacro XPUI_HEADER_TEXT `Uninstall Incomplete` `Setup encountered a problem while uninstalling $(^Name).`
   520 WriteINIStr $PLUGINSDIR\Confirm.ini "Settings" NextButtonText "Close"
   520 WriteINIStr $PLUGINSDIR\Confirm.ini "Settings" NextButtonText "Close"
   521 WriteINIStr $PLUGINSDIR\Confirm.ini "Field 2" Text "An error occured while uninstalling $(^Name)."
   521 WriteINIStr $PLUGINSDIR\Confirm.ini "Field 2" Text "An error occured while uninstalling $(^Name)."
   522 WriteINIStr $PLUGINSDIR\Confirm.ini "Field 3" Text "Click $\"Close$\" to exit.\r\nError: The folder $0 is a nonexistent, system, or invalid directory, or Setup could not locate the file ${EXECUTABLE} in $0."
   522 WriteINIStr $PLUGINSDIR\Confirm.ini "Field 3" Text "Click $\"Close$\" to exit.\r\nError: The folder $0 is a nonexistent, system, or invalid directory, or Setup could not locate the file ${EXECUTABLE} in $0."
   523 WriteINIStr $PLUGINSDIR\Confirm.ini Settings BackEnabled No
   523 WriteINIStr $PLUGINSDIR\Confirm.ini Settings BackEnabled No
   532 InstallOptions::show
   532 InstallOptions::show
   533 Delete $PLUGINSDIR\Confirm.ini
   533 Delete $PLUGINSDIR\Confirm.ini
   534 Return
   534 Return
   535 UninstGood:
   535 UninstGood:
   536 SetOutPath $PLUGINSDIR
   536 SetOutPath $PLUGINSDIR
   537 File "${NSISDIR}\Contrib\ExperienceUI\INI\confirm.ini"
   537 File "${XPUI_SYSDIR}\INI\confirm.ini"
   538 !insertmacro XPUI_HEADER_TEXT `Uninstall Complete` `Setup has successfully uninstalled $(^Name) from your computer.`
   538 !insertmacro XPUI_HEADER_TEXT `Uninstall Complete` `Setup has successfully uninstalled $(^Name) from your computer.`
   539 WriteINIStr $PLUGINSDIR\Confirm.ini "Settings" NextButtonText "Close"
   539 WriteINIStr $PLUGINSDIR\Confirm.ini "Settings" NextButtonText "Close"
   540 WriteINIStr $PLUGINSDIR\Confirm.ini "Field 1" Text "$(^Name) has been successfully uninstalled."
   540 WriteINIStr $PLUGINSDIR\Confirm.ini "Field 1" Text "$(^Name) has been successfully uninstalled."
   541 WriteINIStr $PLUGINSDIR\Confirm.ini "Field 2" Text "Click $\"Close$\" to exit."
   541 WriteINIStr $PLUGINSDIR\Confirm.ini "Field 2" Text "Click $\"Close$\" to exit."
   542 WriteINIStr $PLUGINSDIR\Confirm.ini Settings BackEnabled No
   542 WriteINIStr $PLUGINSDIR\Confirm.ini Settings BackEnabled No