!ifdef MAKEFILE !verbose 0!else !define VERSION 1.1!endif;!define BETA!define BETA_IP 192.168.0.253!define BETA_PORT 8765SetCompress offXPStyle onIcon Update.icoName "ExperienceUI Downloader"Caption "ExperienceUI Update Wizard"OutFile ..\Updater.exeChangeUI all ..\..\UIs\tinyui.exeSubCaption 3 " "SubCaption 4 " "InstallColors 0x000000 0xFFFFFFBrandingText " "CompletedText "Done."!define VER_MAJOR 1!define VER_TENS 1!define VER_ONES 0Page custom welcome lockPage custom infonotice lockPage instfilesFunction welcomeLockWindow onSetOutPath $TEMPFile Updater.iniInstallOptions::initDialog /NOUNLOAD $TEMP\Updater.iniPop $1SetCtlColors $1 0xFFFFFF 0xFFFFFFGetDlgItem $0 $1 1200SetCtlColors $0 0xC0C0C0 0xFFFFFFCreateFont $2 "Verdana" 28 100SendMessage $0 0x30 $2 ""GetDlgItem $0 $1 1201SetCtlColors $0 0x000000 transparentCreateFont $2 "MS Sans Serif" 8 700SendMessage $0 0x30 $2 ""!ifdef BETASendMessage $0 0xC 0 "STR:This is a ßeta release."!endifGetDlgItem $0 $1 1202SetCtlColors $0 0x000000 transparentCreateFont $2 "MS Sans Serif" 8 350SendMessage $0 0x30 $2 ""!ifdef BETASendMessage $0 0xC 0 "STR:This updater will fail unless you have a computer with the IP address ${BETA_IP} on your network, and it has the file xpui/updates.ini on port ${BETA_PORT}. Please e-mail dandaman32@users.sourceforge.net for an updated version of this program!"!endifLockWindow offInstallOptions::showFunctionEndFunction infonoticeSetOutPath $TEMPFile Updater.iniWriteINIStr $TEMP\Updater.ini "Field 1" Left -173InstallOptions::initDialog /NOUNLOAD $TEMP\Updater.iniPop $1SetCtlColors $1 0xFFFFFF 0xFFFFFFGetDlgItem $0 $1 1200SetCtlColors $0 0xC0C0C0 0xFFFFFFCreateFont $2 "Verdana" 28 100SendMessage $0 0x30 $2 ""SendMessage $0 0xC 0 "STR:privacy notice"GetDlgItem $0 $1 1201SetCtlColors $0 0x000000 transparentCreateFont $2 "MS Sans Serif" 8 700SendMessage $0 0x30 $2 ""SendMessage $0 0xC 0 "STR:Your privacy is important."GetDlgItem $0 $1 1202SetCtlColors $0 0x000000 transparentCreateFont $2 "MS Sans Serif" 8 350SendMessage $0 0x30 $2 ""SendMessage $0 0xC 0 "STR:This program does not send any information about to or your computer to anyone. The only thing it does is download a text file from my web server and check its version information."LockWindow offInstallOptions::showFunctionEndFunction lockLockWindow onFunctionEndFunction .onUserAbortLockWindow offFunctionEnd!define LVM_DELETEALLITEMS 0x1009!macro CLSPush $0FindWindow $0 "#32770" "" $HWNDPARENTGetDlgItem $0 $0 1016SendMessage $0 ${LVM_DELETEALLITEMS} 0 0Pop $0!macroendSectionLockWindow offGetDlgItem $0 $HWNDPARENT 1044ShowWindow $0 0GetDlgItem $0 $HWNDPARENT 3ShowWindow $0 0FindWindow $0 "#32770" "" $HWNDPARENTGetDlgItem $0 $0 1004ShowWindow $0 0FindWindow $0 "#32770" "" $HWNDPARENTGetDlgItem $0 $0 1027ShowWindow $0 0GetDlgItem $0 $HWNDPARENT 1ShowWindow $0 0DetailPrint "Connecting to the Internet..."Dialer::AttemptConnectIfErrors noie3Pop $R0!insertmacro CLSDetailPrint "Connecting to the Internet...$R0"StrCmp $R0 "online" connected MessageBox MB_OK|MB_ICONSTOP "The ExperienceUI was unable to establish a connection to the Internet. A few possible reasons for this are:$\n$\n1) You have an Internet provider that requires authentication (such as dial-up) and you did not supply a valid$\n username or password.$\n2) Your firewall is preventing this program ($CMDLINE) from accessing the Internet.$\n3) You do not have an Internet connection set up on this computer.$\n$\nThe updater cannot continue. Please click OK to exit."Call cleanupAbort "Unable to connect."noie3:!insertmacro CLSDetailPrint "Connecting to the Internet...cannot find IE3 or later"MessageBox MB_OK|MB_ICONINFORMATION "The ExperienceUI has detected that you do not have Microsoft Internet Explorer 3 or later installed. The automatic internet connection feature requires MSIE3 or later to work right.$\n$\nPlease connect to the Internet now, and then click OK to continue updating the ExperienceUI."connected:!ifdef BETA nsisdl::download /TRANSLATE "Downloading the update information file..." "Initializing..." " " " " " " s " " "Time left: %d %s%s" "http://${BETA_IP}:${BETA_PORT}/xpui/Updates.ini" "$TEMP\xpuiupd.ini" !else nsisdl::download /TRANSLATE "Downloading the update information file..." "Initializing..." " " " " " " s " " "Time left: %d %s%s" http://xpui.sourceforge.net/bin/Updates.ini "$TEMP\xpuiupd.ini"!endifPop $0StrCmp $0 success GoodINIMessageBox MB_OK|MB_ICONINFORMATION "The ExperienceUI updater was unable to download the update information file from the web site.$\nThe web server may be down, or there may be a problem with your Internet connection.$\n$\nError: $0"Call cleanupSetDetailsPrint textonlyDetailPrint "The updater cannot continue. Click Cancel to exit."SetDetailsPrint listonlyAbort "Release info download failed: $0"Goto DoneGoodINI:DetailPrint "Checking version..."DetailPrint " Current: ${VERSION}"ReadINIStr $0 $TEMP\xpuiupd.ini ExperienceUI DisplayDetailPrint " Latest: $0"ReadINIStr $1 $TEMP\xpuiupd.ini ExperienceUI MajorReadINIStr $2 $TEMP\xpuiupd.ini ExperienceUI TensReadINIStr $3 $TEMP\xpuiupd.ini ExperienceUI OnesReadINIStr $4 $TEMP\xpuiupd.ini ExperienceUI SizeIntCmp $1 ${VER_MAJOR} "" "" UpdatesIntCmp $2 ${VER_TENS} "" "" UpdatesIntCmp $3 ${VER_ONES} "" "" UpdatesGoto NoUpdatesUpdates:ReadINIStr $5 $TEMP\xpuiupd.ini ExperienceUI ClassReadINIStr $6 $TEMP\xpuiupd.ini ExperienceUI HighlightsLine1ReadINIStr $7 $TEMP\xpuiupd.ini ExperienceUI HighlightsLine2 ReadINIStr $8 $TEMP\xpuiupd.ini ExperienceUI TimeIDDetailPrint "Update ready!"MessageBox MB_YESNO|MB_ICONQUESTION "An update is available!$\n$\nYour version: ${VERSION}$\nNew version: $0 (Release ID: $8) $\n$\nThis update is classified as $5.$\n$\nRelease highlights:$\n$6$\n$7$\n$\nDownload it now? (size: ~$4kb)" IDYES DownloadDetailPrint "Update found, but not downloaded."Goto doneDownload:!ifdef BETAnsisdl::download /TRANSLATE "Downloading ExperienceUI version $0..." "Connecting to server..." second minute hour s "%dKB (%d%%) of %dKB at %d.%01dKB/second" "; Time left: %d %s%s" http://${BETA_IP}:${BETA_PORT}/xpui/$0/ExperienceUISetup$0.exe "$DESKTOP\ExperienceUI Setup $0.exe"!elsensisdl::download /TRANSLATE "Downloading ExperienceUI version $0..." "Connecting to server..." second minute hour s "%dKB (%d%%) of %dKB at %d.%01dKB/second" "; Time left: %d %s%s" http://internap.dl.sourceforge.net/sourceforge/xpui/ExperienceUISetup$0.exe "$DESKTOP\ExperienceUI Setup $0.exe"!endifPop $0StrCmp $0 cancel DLCancelledStrCmp $0 success "" DLErrorMessageBox MB_OK|MB_ICONINFORMATION "The file was downloaded successfully to your Desktop."DetailPrint "Update found and downloaded successfully."Goto doneDLCancelled:DetailPrint "Download cancelled."MessageBox MB_OK|MB_ICONINFORMATION "The download was cancelled."Goto doneDLError:SetDetailsPrint textonlyDetailPrint "The updater cannot continue. Click Cancel to exit."SetDetailsPrint listonlyCall CleanupAbort "Download error: $0"MessageBox MB_OK|MB_ICONINFORMATION "The updater was unable to download the file from the web site.$\n$\nThe following error occurred:$\n$0"Goto doneNoUpdates:DetailPrint "No updates available."MessageBox MB_OK|MB_ICONINFORMATION "No updates are available at this time. Please try again later.$\n$\nCurrent version: ${VERSION}$\nLatest version: $0$\n"Done:Call CleanupSectionEndFunction cleanupSetDetailsPrint noneDelete $TEMP\xpuiupd.iniSetDetailsPrint bothFindWindow $R0 "#32770" "" $HWNDPARENTGetDlgItem $R0 $R0 1016ShowWindow $R0 5GetDlgItem $R0 $HWNDPARENT 1ShowWindow $R0 5Functionend