update version

update version

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{27152F71-6514-40BD-9374-74745789C60E}
AppName=HAIETMOBA Reminder
AppVerName=HAIETMOBA Reminder 1.0b1
AppPublisher=Sridhar Ratnakumar
AppPublisherURL=bitbucket.org/srid/haietmoba-reminder/
AppSupportURL=bitbucket.org/srid/haietmoba-reminder/
AppUpdatesURL=bitbucket.org/srid/haietmoba-reminder/
DefaultDirName={pf}\HAIETMOBA Reminder
DefaultGroupName=HAIETMOBA Reminder
LicenseFile=LICENSE.txt
OutputBaseFilename=haietmoba-reminder-setup
SetupIconFile=data\icon.ico
Compression=lzma
SolidCompression=true
DisableProgramGroupPage=true

[Languages]
Name: english; MessagesFile: compiler:Default.isl

[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked

[Files]
Source: dist\haietmoba-reminder.exe; DestDir: {app}; Flags: ignoreversion
Source: dist\__future__.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\_abcoll.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\_socket.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\_socket.pyd; DestDir: {app}; Flags: ignoreversion
Source: dist\_ssl.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\_ssl.pyd; DestDir: {app}; Flags: ignoreversion
Source: dist\_strptime.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\_threading_local.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\abc.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\atexit.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\base64.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\bdb.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\bisect.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\bz2.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\bz2.pyd; DestDir: {app}; Flags: ignoreversion
Source: dist\calendar.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\cmd.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\codecs.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\collections.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\copy.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\copy_reg.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\difflib.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\dis.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\doctest.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\dummy_thread.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\fnmatch.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\functools.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\genericpath.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\getopt.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\gettext.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\glob.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\haietmoba-reminder.exe; DestDir: {app}; Flags: ignoreversion
Source: dist\heapq.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\inspect.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\keyword.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\linecache.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\locale.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\ntpath.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\opcode.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\optparse.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\os.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\os2emxpath.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\pdb.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\pickle.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\posixpath.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\pprint.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\PyQt4.QtCore.pyd; DestDir: {app}; Flags: ignoreversion
Source: dist\PyQt4.QtGui.pyd; DestDir: {app}; Flags: ignoreversion
Source: dist\python26.dll; DestDir: {app}; Flags: ignoreversion
Source: dist\QtCore4.dll; DestDir: {app}; Flags: ignoreversion
Source: dist\QtGui4.dll; DestDir: {app}; Flags: ignoreversion
Source: dist\quopri.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\random.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\re.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\repr.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\select.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\select.pyd; DestDir: {app}; Flags: ignoreversion
Source: dist\shlex.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\sip.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\sip.pyd; DestDir: {app}; Flags: ignoreversion
Source: dist\socket.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\sre.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\sre_compile.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\sre_constants.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\sre_parse.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\ssl.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\stat.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\string.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\StringIO.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\stringprep.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\struct.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\subprocess.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\tempfile.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\textwrap.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\threading.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\token.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\tokenize.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\traceback.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\types.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\unicodedata.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\unicodedata.pyd; DestDir: {app}; Flags: ignoreversion
Source: dist\unittest.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\UserDict.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\w9xpopen.exe; DestDir: {app}; Flags: ignoreversion
Source: dist\warnings.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\webbrowser.pyc; DestDir: {app}; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
Source: dist\data\icon.png; DestDir: {app}\data
Source: dist\encodings\__init__.pyc; DestDir: {app}\encodings
Source: dist\encodings\aliases.pyc; DestDir: {app}\encodings
Source: dist\encodings\ascii.pyc; DestDir: {app}\encodings
Source: dist\encodings\base64_codec.pyc; DestDir: {app}\encodings
Source: dist\encodings\big5.pyc; DestDir: {app}\encodings
Source: dist\encodings\big5hkscs.pyc; DestDir: {app}\encodings
Source: dist\encodings\bz2_codec.pyc; DestDir: {app}\encodings
Source: dist\encodings\charmap.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp037.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp424.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp437.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp500.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp737.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp775.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp850.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp852.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp855.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp856.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp857.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp860.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp861.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp862.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp863.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp864.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp865.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp866.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp869.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp874.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp875.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp932.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp949.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp950.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp1006.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp1026.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp1140.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp1250.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp1251.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp1252.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp1253.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp1254.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp1255.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp1256.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp1257.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp1258.pyc; DestDir: {app}\encodings
Source: dist\encodings\euc_jis_2004.pyc; DestDir: {app}\encodings
Source: dist\encodings\euc_jisx0213.pyc; DestDir: {app}\encodings
Source: dist\encodings\euc_jp.pyc; DestDir: {app}\encodings
Source: dist\encodings\euc_kr.pyc; DestDir: {app}\encodings
Source: dist\encodings\gb2312.pyc; DestDir: {app}\encodings
Source: dist\encodings\gb18030.pyc; DestDir: {app}\encodings
Source: dist\encodings\gbk.pyc; DestDir: {app}\encodings
Source: dist\encodings\hex_codec.pyc; DestDir: {app}\encodings
Source: dist\encodings\hp_roman8.pyc; DestDir: {app}\encodings
Source: dist\encodings\hz.pyc; DestDir: {app}\encodings
Source: dist\encodings\idna.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso2022_jp.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso2022_jp_1.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso2022_jp_2.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso2022_jp_3.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso2022_jp_2004.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso2022_jp_ext.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso2022_kr.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso8859_1.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso8859_2.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso8859_3.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso8859_4.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso8859_5.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso8859_6.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso8859_7.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso8859_8.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso8859_9.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso8859_10.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso8859_11.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso8859_13.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso8859_14.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso8859_15.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso8859_16.pyc; DestDir: {app}\encodings
Source: dist\encodings\johab.pyc; DestDir: {app}\encodings
Source: dist\encodings\koi8_r.pyc; DestDir: {app}\encodings
Source: dist\encodings\koi8_u.pyc; DestDir: {app}\encodings
Source: dist\encodings\latin_1.pyc; DestDir: {app}\encodings
Source: dist\encodings\mac_arabic.pyc; DestDir: {app}\encodings
Source: dist\encodings\mac_centeuro.pyc; DestDir: {app}\encodings
Source: dist\encodings\mac_croatian.pyc; DestDir: {app}\encodings
Source: dist\encodings\mac_cyrillic.pyc; DestDir: {app}\encodings
Source: dist\encodings\mac_farsi.pyc; DestDir: {app}\encodings
Source: dist\encodings\mac_greek.pyc; DestDir: {app}\encodings
Source: dist\encodings\mac_iceland.pyc; DestDir: {app}\encodings
Source: dist\encodings\mac_latin2.pyc; DestDir: {app}\encodings
Source: dist\encodings\mac_roman.pyc; DestDir: {app}\encodings
Source: dist\encodings\mac_romanian.pyc; DestDir: {app}\encodings
Source: dist\encodings\mac_turkish.pyc; DestDir: {app}\encodings
Source: dist\encodings\mbcs.pyc; DestDir: {app}\encodings
Source: dist\encodings\palmos.pyc; DestDir: {app}\encodings
Source: dist\encodings\ptcp154.pyc; DestDir: {app}\encodings
Source: dist\encodings\punycode.pyc; DestDir: {app}\encodings
Source: dist\encodings\quopri_codec.pyc; DestDir: {app}\encodings
Source: dist\encodings\raw_unicode_escape.pyc; DestDir: {app}\encodings
Source: dist\encodings\rot_13.pyc; DestDir: {app}\encodings
Source: dist\encodings\shift_jis.pyc; DestDir: {app}\encodings
Source: dist\encodings\shift_jis_2004.pyc; DestDir: {app}\encodings
Source: dist\encodings\shift_jisx0213.pyc; DestDir: {app}\encodings
Source: dist\encodings\string_escape.pyc; DestDir: {app}\encodings
Source: dist\encodings\tis_620.pyc; DestDir: {app}\encodings
Source: dist\encodings\undefined.pyc; DestDir: {app}\encodings
Source: dist\encodings\unicode_escape.pyc; DestDir: {app}\encodings
Source: dist\encodings\unicode_internal.pyc; DestDir: {app}\encodings
Source: dist\encodings\utf_7.pyc; DestDir: {app}\encodings
Source: dist\encodings\utf_8.pyc; DestDir: {app}\encodings
Source: dist\encodings\utf_8_sig.pyc; DestDir: {app}\encodings
Source: dist\encodings\utf_16.pyc; DestDir: {app}\encodings
Source: dist\encodings\utf_16_be.pyc; DestDir: {app}\encodings
Source: dist\encodings\utf_16_le.pyc; DestDir: {app}\encodings
Source: dist\encodings\utf_32.pyc; DestDir: {app}\encodings
Source: dist\encodings\utf_32_be.pyc; DestDir: {app}\encodings
Source: dist\encodings\utf_32_le.pyc; DestDir: {app}\encodings
Source: dist\encodings\uu_codec.pyc; DestDir: {app}\encodings
Source: dist\encodings\zlib_codec.pyc; DestDir: {app}\encodings
Source: dist\PyQt4\__init__.pyc; DestDir: {app}\PyQt4
Source: dist\PyQt4\QtCore.pyc; DestDir: {app}\PyQt4
Source: dist\PyQt4\QtGui.pyc; DestDir: {app}\PyQt4
Source: dist\data\icon.ico; DestDir: {app}\data

[Icons]
Name: {group}\HAIETMOBA Reminder; Filename: {app}\haietmoba-reminder.exe; IconFilename: {app}\data\icon.ico; IconIndex: 0
Name: {group}\{cm:UninstallProgram,HAIETMOBA Reminder}; Filename: {uninstallexe}
Name: {commondesktop}\HAIETMOBA Reminder; Filename: {app}\haietmoba-reminder.exe; Tasks: desktopicon; IconFilename: {app}\data\icon.ico
Name: {commonstartup}\HAIETMOBA Reminder; Filename: {app}\haietmoba-reminder.exe; IconFilename: {app}\data\icon.ico

[Run]
Filename: {app}\haietmoba-reminder.exe; Description: {cm:LaunchProgram,HAIETMOBA Reminder}; Flags: nowait postinstall skipifsilent

[Dirs]
Name: {app}\data
Name: encodings
Name: PyQt4

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{27152F71-6514-40BD-9374-74745789C60E}
AppName=HAIETMOBA Reminder
AppVerName=HAIETMOBA Reminder 0.1b1
AppPublisher=Sridhar Ratnakumar
AppPublisherURL=bitbucket.org/srid/haietmoba-reminder/
AppSupportURL=bitbucket.org/srid/haietmoba-reminder/
AppUpdatesURL=bitbucket.org/srid/haietmoba-reminder/
DefaultDirName={pf}\HAIETMOBA Reminder
DefaultGroupName=HAIETMOBA Reminder
LicenseFile=LICENSE.txt
OutputBaseFilename=haietmoba-reminder-setup
SetupIconFile=data\icon.ico
Compression=lzma
SolidCompression=true
DisableProgramGroupPage=true

[Languages]
Name: english; MessagesFile: compiler:Default.isl

[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked

[Files]
Source: dist\haietmoba-reminder.exe; DestDir: {app}; Flags: ignoreversion
Source: dist\__future__.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\_abcoll.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\_socket.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\_socket.pyd; DestDir: {app}; Flags: ignoreversion
Source: dist\_ssl.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\_ssl.pyd; DestDir: {app}; Flags: ignoreversion
Source: dist\_strptime.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\_threading_local.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\abc.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\atexit.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\base64.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\bdb.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\bisect.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\bz2.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\bz2.pyd; DestDir: {app}; Flags: ignoreversion
Source: dist\calendar.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\cmd.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\codecs.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\collections.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\copy.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\copy_reg.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\difflib.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\dis.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\doctest.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\dummy_thread.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\fnmatch.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\functools.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\genericpath.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\getopt.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\gettext.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\glob.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\haietmoba-reminder.exe; DestDir: {app}; Flags: ignoreversion
Source: dist\heapq.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\inspect.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\keyword.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\linecache.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\locale.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\ntpath.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\opcode.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\optparse.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\os.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\os2emxpath.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\pdb.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\pickle.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\posixpath.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\pprint.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\PyQt4.QtCore.pyd; DestDir: {app}; Flags: ignoreversion
Source: dist\PyQt4.QtGui.pyd; DestDir: {app}; Flags: ignoreversion
Source: dist\python26.dll; DestDir: {app}; Flags: ignoreversion
Source: dist\QtCore4.dll; DestDir: {app}; Flags: ignoreversion
Source: dist\QtGui4.dll; DestDir: {app}; Flags: ignoreversion
Source: dist\quopri.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\random.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\re.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\repr.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\select.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\select.pyd; DestDir: {app}; Flags: ignoreversion
Source: dist\shlex.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\sip.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\sip.pyd; DestDir: {app}; Flags: ignoreversion
Source: dist\socket.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\sre.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\sre_compile.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\sre_constants.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\sre_parse.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\ssl.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\stat.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\string.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\StringIO.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\stringprep.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\struct.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\subprocess.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\tempfile.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\textwrap.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\threading.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\token.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\tokenize.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\traceback.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\types.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\unicodedata.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\unicodedata.pyd; DestDir: {app}; Flags: ignoreversion
Source: dist\unittest.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\UserDict.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\w9xpopen.exe; DestDir: {app}; Flags: ignoreversion
Source: dist\warnings.pyc; DestDir: {app}; Flags: ignoreversion
Source: dist\webbrowser.pyc; DestDir: {app}; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
Source: dist\data\icon.png; DestDir: {app}\data
Source: dist\encodings\__init__.pyc; DestDir: {app}\encodings
Source: dist\encodings\aliases.pyc; DestDir: {app}\encodings
Source: dist\encodings\ascii.pyc; DestDir: {app}\encodings
Source: dist\encodings\base64_codec.pyc; DestDir: {app}\encodings
Source: dist\encodings\big5.pyc; DestDir: {app}\encodings
Source: dist\encodings\big5hkscs.pyc; DestDir: {app}\encodings
Source: dist\encodings\bz2_codec.pyc; DestDir: {app}\encodings
Source: dist\encodings\charmap.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp037.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp424.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp437.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp500.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp737.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp775.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp850.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp852.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp855.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp856.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp857.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp860.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp861.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp862.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp863.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp864.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp865.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp866.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp869.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp874.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp875.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp932.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp949.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp950.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp1006.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp1026.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp1140.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp1250.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp1251.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp1252.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp1253.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp1254.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp1255.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp1256.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp1257.pyc; DestDir: {app}\encodings
Source: dist\encodings\cp1258.pyc; DestDir: {app}\encodings
Source: dist\encodings\euc_jis_2004.pyc; DestDir: {app}\encodings
Source: dist\encodings\euc_jisx0213.pyc; DestDir: {app}\encodings
Source: dist\encodings\euc_jp.pyc; DestDir: {app}\encodings
Source: dist\encodings\euc_kr.pyc; DestDir: {app}\encodings
Source: dist\encodings\gb2312.pyc; DestDir: {app}\encodings
Source: dist\encodings\gb18030.pyc; DestDir: {app}\encodings
Source: dist\encodings\gbk.pyc; DestDir: {app}\encodings
Source: dist\encodings\hex_codec.pyc; DestDir: {app}\encodings
Source: dist\encodings\hp_roman8.pyc; DestDir: {app}\encodings
Source: dist\encodings\hz.pyc; DestDir: {app}\encodings
Source: dist\encodings\idna.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso2022_jp.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso2022_jp_1.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso2022_jp_2.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso2022_jp_3.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso2022_jp_2004.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso2022_jp_ext.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso2022_kr.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso8859_1.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso8859_2.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso8859_3.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso8859_4.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso8859_5.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso8859_6.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso8859_7.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso8859_8.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso8859_9.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso8859_10.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso8859_11.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso8859_13.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso8859_14.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso8859_15.pyc; DestDir: {app}\encodings
Source: dist\encodings\iso8859_16.pyc; DestDir: {app}\encodings
Source: dist\encodings\johab.pyc; DestDir: {app}\encodings
Source: dist\encodings\koi8_r.pyc; DestDir: {app}\encodings
Source: dist\encodings\koi8_u.pyc; DestDir: {app}\encodings
Source: dist\encodings\latin_1.pyc; DestDir: {app}\encodings
Source: dist\encodings\mac_arabic.pyc; DestDir: {app}\encodings
Source: dist\encodings\mac_centeuro.pyc; DestDir: {app}\encodings
Source: dist\encodings\mac_croatian.pyc; DestDir: {app}\encodings
Source: dist\encodings\mac_cyrillic.pyc; DestDir: {app}\encodings
Source: dist\encodings\mac_farsi.pyc; DestDir: {app}\encodings
Source: dist\encodings\mac_greek.pyc; DestDir: {app}\encodings
Source: dist\encodings\mac_iceland.pyc; DestDir: {app}\encodings
Source: dist\encodings\mac_latin2.pyc; DestDir: {app}\encodings
Source: dist\encodings\mac_roman.pyc; DestDir: {app}\encodings
Source: dist\encodings\mac_romanian.pyc; DestDir: {app}\encodings
Source: dist\encodings\mac_turkish.pyc; DestDir: {app}\encodings
Source: dist\encodings\mbcs.pyc; DestDir: {app}\encodings
Source: dist\encodings\palmos.pyc; DestDir: {app}\encodings
Source: dist\encodings\ptcp154.pyc; DestDir: {app}\encodings
Source: dist\encodings\punycode.pyc; DestDir: {app}\encodings
Source: dist\encodings\quopri_codec.pyc; DestDir: {app}\encodings
Source: dist\encodings\raw_unicode_escape.pyc; DestDir: {app}\encodings
Source: dist\encodings\rot_13.pyc; DestDir: {app}\encodings
Source: dist\encodings\shift_jis.pyc; DestDir: {app}\encodings
Source: dist\encodings\shift_jis_2004.pyc; DestDir: {app}\encodings
Source: dist\encodings\shift_jisx0213.pyc; DestDir: {app}\encodings
Source: dist\encodings\string_escape.pyc; DestDir: {app}\encodings
Source: dist\encodings\tis_620.pyc; DestDir: {app}\encodings
Source: dist\encodings\undefined.pyc; DestDir: {app}\encodings
Source: dist\encodings\unicode_escape.pyc; DestDir: {app}\encodings
Source: dist\encodings\unicode_internal.pyc; DestDir: {app}\encodings
Source: dist\encodings\utf_7.pyc; DestDir: {app}\encodings
Source: dist\encodings\utf_8.pyc; DestDir: {app}\encodings
Source: dist\encodings\utf_8_sig.pyc; DestDir: {app}\encodings
Source: dist\encodings\utf_16.pyc; DestDir: {app}\encodings
Source: dist\encodings\utf_16_be.pyc; DestDir: {app}\encodings
Source: dist\encodings\utf_16_le.pyc; DestDir: {app}\encodings
Source: dist\encodings\utf_32.pyc; DestDir: {app}\encodings
Source: dist\encodings\utf_32_be.pyc; DestDir: {app}\encodings
Source: dist\encodings\utf_32_le.pyc; DestDir: {app}\encodings
Source: dist\encodings\uu_codec.pyc; DestDir: {app}\encodings
Source: dist\encodings\zlib_codec.pyc; DestDir: {app}\encodings
Source: dist\PyQt4\__init__.pyc; DestDir: {app}\PyQt4
Source: dist\PyQt4\QtCore.pyc; DestDir: {app}\PyQt4
Source: dist\PyQt4\QtGui.pyc; DestDir: {app}\PyQt4
Source: dist\data\icon.ico; DestDir: {app}\data

[Icons]
Name: {group}\HAIETMOBA Reminder; Filename: {app}\haietmoba-reminder.exe; IconFilename: {app}\data\icon.ico; IconIndex: 0
Name: {group}\{cm:UninstallProgram,HAIETMOBA Reminder}; Filename: {uninstallexe}
Name: {commondesktop}\HAIETMOBA Reminder; Filename: {app}\haietmoba-reminder.exe; Tasks: desktopicon; IconFilename: {app}\data\icon.ico
Name: {commonstartup}\HAIETMOBA Reminder; Filename: {app}\haietmoba-reminder.exe; IconFilename: {app}\data\icon.ico

[Run]
Filename: {app}\haietmoba-reminder.exe; Description: {cm:LaunchProgram,HAIETMOBA Reminder}; Flags: nowait postinstall skipifsilent

[Dirs]
Name: {app}\data
Name: encodings
Name: PyQt4


Update msi31.iss

Update msi31.iss

[CustomMessages]
msi31_title=Windows Installer 3.1

en.msi31_size=2.5 MB
de.msi31_size=2,5 MB
es.msi31_size=2,5 MB

[Code]
const
	msi31_url = 'http://download.microsoft.com/download/1/4/7/147ded26-931c-4daf-9095-ec7baf996f46/WindowsInstaller-KB893803-v2-x86.exe';

procedure msi31(MinVersion: string);
begin
	// Check for required Windows Installer 3.0 on Windows 2000 or higher
	if (IsX86() and minwinversion(5, 0) and (compareversion(fileversion(ExpandConstant('{sys}{\}msi.dll')), MinVersion) < 0)) then
		AddProduct('msi31.exe',
			'/passive /norestart',
			CustomMessage('msi31_title'),
			CustomMessage('msi31_size'),
			msi31_url,
			false, false);
end;

[CustomMessages]
msi31_title=Windows Installer 3.1

en.msi31_size=2.5 MB
de.msi31_size=2,5 MB

[Code]
const
	msi31_url = 'http://download.microsoft.com/download/1/4/7/147ded26-931c-4daf-9095-ec7baf996f46/WindowsInstaller-KB893803-v2-x86.exe';

procedure msi31(MinVersion: string);
begin
	// Check for required Windows Installer 3.0 on Windows 2000 or higher
	if (IsX86() and minwinversion(5, 0) and (compareversion(fileversion(ExpandConstant('{sys}{\}msi.dll')), MinVersion) < 0)) then
		AddProduct('msi31.exe',
			'/passive /norestart',
			CustomMessage('msi31_title'),
			CustomMessage('msi31_size'),
			msi31_url,
			false, false);
end;


主窗口添加标题。

主窗口添加标题。

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;此脚本主要模仿并实现“好压”安装程序的界面                                                           ;
;请使用 Unicode 版 Inno Setup 5.5.9（或更新） 编译器编译                                            ;
;经测试，此脚本可以在官方原版编译器、SkyGZ增强版编译器和Restools增强版编译器上完美编译通过并正常运行;
;令人遗憾的是原始脚本作者已不可考                                                                   ;
;代码主要思路来源于：http://blog.csdn.net/oceanlucy/article/details/50033773                        ;
;感谢博主 “沉森心” （oceanlucy）                                                                    ;
;此脚本也经过了几个网友的改进，但已无法具体考证，但我仍然很感谢他们                                 ;
;最终版本由 “赵宇航”/“糖鸭君”/“糖鸭”/“唐雅”/“wangwenx190” 修改得到                                  ;
;欢迎大家传播和完善此脚本                                                                           ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

#IF VER < EncodeVer(5,5,9)
  #error 请升级您的 Inno Setup 编译器到 V5.5.9 或更新的版本
#endif

#ifndef UNICODE
  #error 请使用 Unicode 版 Inno Setup 编译器
#endif

#define MyAppID "{751134E2-9659-4800-B491-787AF330DAED}"
#define MyAppName "My Program"
#define MyAppVersion "1.5"
#define MyAppPublisher "My Company, Inc."
#define MyAppPublisherURL "http://www.example.com/"
#define MyAppSupportURL MyAppPublisherURL
#define MyAppUpdatesURL MyAppPublisherURL
#define MyAppComments "备注"
#define MyAppContact MyAppPublisher
#define MyAppSupportPhone "13510102020"
#define MyAppReadmeURL "https://github.com/wangwenx190/InternetFashionedInstaller/blob/master/README.md"
#define MyAppLicenseURL "https://github.com/wangwenx190/InternetFashionedInstaller/blob/master/LICENSE"
#define MyAppCopyrightYear "2017"
#define MyAppCopyright "版权所有 © " + MyAppCopyrightYear + ", " + MyAppPublisher
#define MyAppExeName "MyProg.exe"

[Setup]
AppId={{#MyAppID}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppPublisherURL}
AppSupportURL={#MyAppSupportURL}
AppUpdatesURL={#MyAppUpdatesURL}
AppComments={#MyAppComments}
AppContact={#MyAppContact}
AppSupportPhone={#MyAppSupportPhone}
AppReadmeFile={#MyAppReadmeURL}
AppCopyright={#MyAppCopyright}
DefaultDirName={pf}\{#MyAppPublisher}\{#MyAppName}
DefaultGroupName={#MyAppPublisher}\{#MyAppName}
OutputBaseFilename={#MyAppName}_{#MyAppVersion}_Setup
VersionInfoDescription={#MyAppName} 安装程序
VersionInfoProductName={#MyAppName}
VersionInfoCompany={#MyAppPublisher}
VersionInfoCopyright={#MyAppCopyright}
VersionInfoProductVersion={#MyAppVersion}
VersionInfoProductTextVersion={#MyAppVersion}
VersionInfoTextVersion={#MyAppVersion}
VersionInfoVersion={#MyAppVersion}
OutputDir=.\Output\
SetupIconFile=.\Setup.ico
Compression=lzma2/ultra64
InternalCompressLevel=ultra64
SolidCompression=yes
DisableProgramGroupPage=yes
DisableDirPage=yes
DisableReadyPage=yes
MinVersion=0,6.1.7601
TimeStampsInUTC=yes
Uninstallable=yes
SetupMutex={{#MyAppID}Installer,Global\{{#MyAppID}Installer
AppMutex={#MyAppName}
ShowLanguageDialog=no
UninstallDisplayName={#MyAppName}
UninstallDisplayIcon={uninstallexe},0
;ChangesAssociations=yes

[Languages]
Name: "zh_CN"; MessagesFile: ".\lang\zh-CN.isl"

[Files]
Source: ".\app\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: ".\tmp\botva2.dll"; DestDir: "{tmp}\botva2.dll"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\InnoCallback.dll"; DestDir: "{tmp}\InnoCallback.dll"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\background_finish.png"; DestDir: "{tmp}\background_finish.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\background_installing.png"; DestDir: "{tmp}\background_installing.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\background_messagebox.png"; DestDir: "{tmp}\background_messagebox.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\background_welcome.png"; DestDir: "{tmp}\background_welcome.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\background_welcome_more.png"; DestDir: "{tmp}\background_welcome_more.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\button_browse.png"; DestDir: "{tmp}\button_browse.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\button_cancel.png"; DestDir: "{tmp}\button_cancel.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\button_close.png"; DestDir: "{tmp}\button_close.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\button_customize_setup.png"; DestDir: "{tmp}\button_customize_setup.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\button_finish.png"; DestDir: "{tmp}\button_finish.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\button_license.png"; DestDir: "{tmp}\button_license.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\button_minimize.png"; DestDir: "{tmp}\button_minimize.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\button_ok.png"; DestDir: "{tmp}\button_ok.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\button_setup_or_next.png"; DestDir: "{tmp}\button_setup_or_next.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\button_uncustomize_setup.png"; DestDir: "{tmp}\button_uncustomize_setup.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\checkbox_license.png"; DestDir: "{tmp}\checkbox_license.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\checkbox_setdefault.png"; DestDir: "{tmp}\checkbox_setdefault.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\progressbar_background.png"; DestDir: "{tmp}\progressbar_background.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\progressbar_foreground.png"; DestDir: "{tmp}\progressbar_foreground.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system

;若有写入注册表条目的需要，请取消此区段的注释并自行添加相关脚本
;[Registry]
;Root: HKCU; Subkey: "Software\My Company"; Flags: uninsdeletekeyifempty
;Root: HKCU; Subkey: "Software\My Company\My Program"; Flags: uninsdeletekey
;Root: HKLM; Subkey: "Software\My Company"; Flags: uninsdeletekeyifempty
;Root: HKLM; Subkey: "Software\My Company\My Program"; Flags: uninsdeletekey
;Root: HKLM; Subkey: "Software\My Company\My Program\Settings"; ValueType: string; ValueName: "InstallPath"; ValueData: "{app}"

;若有创建快捷方式的需要，请取消此区段的注释并自行添加相关脚本
;[Icons]
;Name: "{group}\My Program"; Filename: "{app}\MYPROG.EXE"; Parameters: "/play filename.mid"; WorkingDir: "{app}"; Comment: "This is my program"; IconFilename: "{app}\myicon.ico"
;Name: "{group}\Documents"; Filename: "{app}\Doc"; Flags: foldershortcut

[UninstallDelete]
Type: filesandordirs; Name: "{app}"

[Code]
CONST
  PRODUCT_REGISTRY_KEY_32 = 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#MyAppID}_is1';
  PRODUCT_REGISTRY_KEY_64 = 'SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{#MyAppID}_is1';
  WM_SYSCOMMAND = $0112;
  ID_BUTTON_ON_CLICK_EVENT = 1;
  WIZARDFORM_WIDTH_NORMAL = 600;
  WIZARDFORM_HEIGHT_NORMAL = 400;
  WIZARDFORM_HEIGHT_MORE = 503;

VAR
  label_wizardform_main, label_messagebox_main, label_wizardform_more_product_already_installed, label_messagebox_information, label_messagebox_title, label_wizardform_title : TLabel;
  image_wizardform_background, image_messagebox_background, image_progressbar_background, image_progressbar_foreground, PBOldProc : LONGINT;
  button_license, button_minimize, button_close, button_browse, button_setup_or_next, button_customize_setup, button_uncustomize_setup, checkbox_license, checkbox_setdefault, button_messagebox_close, button_messagebox_ok, button_messagebox_cancel : HWND;
  is_wizardform_show_normal, is_installer_initialized, is_platform_windows_7, is_wizardform_released, can_exit_setup : BOOLEAN;
  edit_target_path : TEdit;
  version_installed_before : EXTENDED;
  messagebox_close : TSetupForm;

TYPE
  TBtnEventProc = PROCEDURE(h : HWND);
  TPBProc = FUNCTION(h : hWnd; Msg, wParam, lParam : LONGINT) : LONGINT;

FUNCTION  ImgLoad(h : HWND; FileName : PAnsiChar; Left, Top, Width, Height : INTEGER; Stretch, IsBkg : BOOLEAN) : LONGINT; EXTERNAL 'ImgLoad@files:botva2.dll STDCALL DELAYLOAD';
PROCEDURE ImgSetVisibility(img : LONGINT; Visible : BOOLEAN); EXTERNAL 'ImgSetVisibility@files:botva2.dll STDCALL DELAYLOAD';
PROCEDURE ImgApplyChanges(h : HWND); EXTERNAL 'ImgApplyChanges@files:botva2.dll STDCALL DELAYLOAD';
PROCEDURE ImgSetPosition(img : LONGINT; NewLeft, NewTop, NewWidth, NewHeight : INTEGER); EXTERNAL 'ImgSetPosition@files:botva2.dll STDCALL DELAYLOAD';
PROCEDURE ImgRelease(img : LONGINT); EXTERNAL 'ImgRelease@files:botva2.dll STDCALL DELAYLOAD';
PROCEDURE CreateFormFromImage(h : HWND; FileName : PAnsiChar); EXTERNAL 'CreateFormFromImage@files:botva2.dll STDCALL DELAYLOAD';
PROCEDURE gdipShutdown();  EXTERNAL 'gdipShutdown@files:botva2.dll STDCALL DELAYLOAD';
FUNCTION  WrapBtnCallback(Callback : TBtnEventProc; ParamCount : INTEGER) : LONGWORD; EXTERNAL 'wrapcallback@files:innocallback.dll STDCALL DELAYLOAD';
FUNCTION  BtnCreate(hParent : HWND; Left, Top, Width, Height : INTEGER; FileName : PAnsiChar; ShadowWidth : INTEGER; IsCheckBtn : BOOLEAN) : HWND;  EXTERNAL 'BtnCreate@files:botva2.dll STDCALL DELAYLOAD';
PROCEDURE BtnSetVisibility(h : HWND; Value : BOOLEAN); EXTERNAL 'BtnSetVisibility@files:botva2.dll STDCALL DELAYLOAD';
PROCEDURE BtnSetEvent(h : HWND; EventID : INTEGER; Event : LONGWORD); EXTERNAL 'BtnSetEvent@files:botva2.dll STDCALL DELAYLOAD';
PROCEDURE BtnSetEnabled(h : HWND; Value : BOOLEAN); EXTERNAL 'BtnSetEnabled@files:botva2.dll STDCALL DELAYLOAD';
FUNCTION  BtnGetChecked(h : HWND) : BOOLEAN; EXTERNAL 'BtnGetChecked@files:botva2.dll STDCALL DELAYLOAD';
PROCEDURE BtnSetChecked(h : HWND; Value : BOOLEAN); EXTERNAL 'BtnSetChecked@files:botva2.dll STDCALL DELAYLOAD';
PROCEDURE BtnSetPosition(h : HWND; NewLeft, NewTop, NewWidth, NewHeight : INTEGER);  EXTERNAL 'BtnSetPosition@files:botva2.dll STDCALL DELAYLOAD';
FUNCTION  SetWindowLong(h : HWnd; Index : INTEGER; NewLong : LONGINT) : LONGINT; EXTERNAL 'SetWindowLongA@user32.dll STDCALL';
FUNCTION  PBCallBack(P : TPBProc; ParamCount : INTEGER) : LONGWORD; EXTERNAL 'wrapcallback@files:innocallback.dll STDCALL DELAYLOAD';
FUNCTION  CallWindowProc(lpPrevWndFunc : LONGINT; h : HWND; Msg : UINT; wParam, lParam : LONGINT) : LONGINT; EXTERNAL 'CallWindowProcA@user32.dll STDCALL';
PROCEDURE ImgSetVisiblePart(img : LONGINT; NewLeft, NewTop, NewWidth, NewHeight : INTEGER); EXTERNAL 'ImgSetVisiblePart@files:botva2.dll STDCALL DELAYLOAD';
FUNCTION  ReleaseCapture() : LONGINT; EXTERNAL 'ReleaseCapture@user32.dll STDCALL';
FUNCTION  CreateRoundRectRgn(p1, p2, p3, p4, p5, p6 : INTEGER) : THandle; EXTERNAL 'CreateRoundRectRgn@gdi32 STDCALL';
FUNCTION  SetWindowRgn(h : HWND; hRgn : THandle; bRedraw : BOOLEAN) : INTEGER; EXTERNAL 'SetWindowRgn@user32 STDCALL';

//调用这个函数可以使矩形窗口转变为圆角矩形窗口
PROCEDURE shape_form_round(aForm : TForm; edgeSize : INTEGER);
VAR
  FormRegion : LONGWORD;
BEGIN
  FormRegion := CreateRoundRectRgn(0, 0, aForm.Width, aForm.Height, edgeSize, edgeSize);
  SetWindowRgn(aForm.Handle, FormRegion, TRUE);
END;

FUNCTION is_installed_before() : BOOLEAN;
VAR
  oldVersion : STRING;
BEGIN
  IF is_platform_windows_7 THEN
  BEGIN
    IF IsWin64 THEN
    BEGIN
      IF RegKeyExists(HKEY_LOCAL_MACHINE, PRODUCT_REGISTRY_KEY_64) THEN
      BEGIN
        RegQueryStringValue(HKEY_LOCAL_MACHINE, PRODUCT_REGISTRY_KEY_64, 'DisplayVersion', oldVersion);
        version_installed_before := StrToFloat(oldVersion);
        Result := TRUE;
      END ELSE
      BEGIN
        version_installed_before := 0.0;
        Result := FALSE;
      END;
    END ELSE
    BEGIN
      IF RegKeyExists(HKEY_LOCAL_MACHINE, PRODUCT_REGISTRY_KEY_32) THEN
      BEGIN
        RegQueryStringValue(HKEY_LOCAL_MACHINE, PRODUCT_REGISTRY_KEY_32, 'DisplayVersion', oldVersion);
        version_installed_before := StrToFloat(oldVersion);
        Result := TRUE;
      END ELSE
      BEGIN
        version_installed_before := 0.0;
        Result := FALSE;
      END;
    END;
  END ELSE
  BEGIN
    IF RegKeyExists(HKEY_LOCAL_MACHINE, PRODUCT_REGISTRY_KEY_32) THEN
      BEGIN
        RegQueryStringValue(HKEY_LOCAL_MACHINE, PRODUCT_REGISTRY_KEY_32, 'DisplayVersion', oldVersion);
        version_installed_before := StrToFloat(oldVersion);
        Result := TRUE;
      END ELSE
      BEGIN
        version_installed_before := 0.0;
        Result := FALSE;
      END;
  END;
END;

PROCEDURE button_close_on_click(hBtn : HWND);
BEGIN
  WizardForm.CancelButton.OnClick(WizardForm);
END;

PROCEDURE button_minimize_on_click(hBtn : HWND);
BEGIN
  SendMessage(WizardForm.Handle, WM_SYSCOMMAND, 61472, 0);
END;

PROCEDURE button_customize_setup_on_click(hBtn : HWND);
BEGIN
  IF is_wizardform_show_normal THEN
  BEGIN
    WizardForm.Height := WIZARDFORM_HEIGHT_MORE;
    image_wizardform_background := ImgLoad(WizardForm.Handle, ExpandConstant('{tmp}\background_welcome_more.png'), 0, 0, WIZARDFORM_WIDTH_NORMAL, WIZARDFORM_HEIGHT_MORE, FALSE, TRUE);
    edit_target_path.Show;
    BtnSetVisibility(button_browse, TRUE);
    BtnSetVisibility(checkbox_setdefault, TRUE);
    BtnSetVisibility(button_customize_setup, FALSE);
    BtnSetVisibility(button_uncustomize_setup, TRUE);
    IF is_installed_before() THEN
    BEGIN
      edit_target_path.Enabled := FALSE;
      BtnSetEnabled(button_browse, FALSE);
      label_wizardform_more_product_already_installed.Show;
    END;
    is_wizardform_show_normal := FALSE;
  END ELSE
  BEGIN
    edit_target_path.Hide;
    label_wizardform_more_product_already_installed.Hide;
    BtnSetVisibility(button_browse, FALSE);
    BtnSetVisibility(checkbox_setdefault, FALSE);
    WizardForm.Height := WIZARDFORM_HEIGHT_NORMAL;
    image_wizardform_background := ImgLoad(WizardForm.Handle, ExpandConstant('{tmp}\background_welcome.png'), 0, 0, WIZARDFORM_WIDTH_NORMAL, WIZARDFORM_HEIGHT_NORMAL, FALSE, TRUE);
    BtnSetVisibility(button_customize_setup, TRUE);
    BtnSetVisibility(button_uncustomize_setup, FALSE);
    is_wizardform_show_normal := TRUE;
  END;
  ImgApplyChanges(WizardForm.Handle);
END;

PROCEDURE button_browse_on_click(hBtn : HWND);
BEGIN
  WizardForm.DirBrowseButton.OnClick(WizardForm);
  edit_target_path.Text := WizardForm.DirEdit.Text;
END;

PROCEDURE edit_target_path_on_change(Sender : TObject);
BEGIN
  WizardForm.DirEdit.Text := edit_target_path.Text;
END;

PROCEDURE checkbox_license_on_click(hBtn : HWND);
BEGIN
    IF BtnGetChecked(checkbox_license) THEN
    BEGIN
      BtnSetEnabled(button_setup_or_next, TRUE);
    END ELSE
    BEGIN
      BtnSetEnabled(button_setup_or_next, FALSE);
    END;
END;

PROCEDURE checkbox_setdefault_on_click(hBtn : HWND);
BEGIN
  //TODO
END;

FUNCTION is_setdefault_checkbox_checked() : BOOLEAN;
BEGIN
  Result := BtnGetChecked(checkbox_setdefault);
END;

PROCEDURE check_if_need_change_associations();
BEGIN
  IF is_setdefault_checkbox_checked() THEN
  BEGIN
    //TODO
  END;
END;

PROCEDURE button_setup_or_next_on_click(hBtn : HWND);
BEGIN
  WizardForm.NextButton.OnClick(WizardForm);
END;

FUNCTION PBProc(h : hWnd; Msg, wParam, lParam : LONGINT) : LONGINT;
VAR
  pr, i1, i2 : EXTENDED;
  w : INTEGER;
BEGIN
  Result := CallWindowProc(PBOldProc, h, Msg, wParam, lParam);
  IF ((Msg = $402) AND (WizardForm.ProgressGauge.Position > WizardForm.ProgressGauge.Min)) THEN
  BEGIN
    i1 := WizardForm.ProgressGauge.Position - WizardForm.ProgressGauge.Min;
    i2 := WizardForm.ProgressGauge.Max - WizardForm.ProgressGauge.Min;
    pr := i1 * 100 / i2;
    w := Round(560 * pr / 100);
    ImgSetPosition(image_progressbar_foreground, 20, 374, w, 6);
    ImgSetVisiblePart(image_progressbar_foreground, 0, 0, w, 6);
    ImgApplyChanges(WizardForm.Handle);
  END;
END;

PROCEDURE button_license_on_click(hBtn : HWND);
VAR
  ErrorCode : INTEGER;
BEGIN
  ShellExec('', '{#MyAppLicenseURL}', '', '', SW_SHOW, ewNoWait, ErrorCode);
END;

PROCEDURE button_messagebox_ok_on_click(hBtn : HWND);
BEGIN
  can_exit_setup := TRUE;
  messagebox_close.Close();
END;

PROCEDURE button_messagebox_cancel_on_click(hBtn : HWND);
BEGIN
  can_exit_setup := FALSE;
  messagebox_close.Close();
END;

PROCEDURE wizardform_on_mouse_down(Sender : TObject; Button : TMouseButton; Shift : TShiftState; X, Y : INTEGER);
BEGIN
  ReleaseCapture();
  SendMessage(WizardForm.Handle, WM_SYSCOMMAND, $F012, 0);
END;

PROCEDURE messagebox_on_mouse_down(Sender : TObject; Button : TMouseButton; Shift : TShiftState; X, Y : INTEGER);
BEGIN
  ReleaseCapture();
  SendMessage(messagebox_close.Handle, WM_SYSCOMMAND, $F012, 0);
END;

PROCEDURE determine_wether_is_windows_7_or_not();
VAR
  sysVersion : TWindowsVersion;
BEGIN
  GetWindowsVersionEx(sysVersion);
  IF sysVersion.NTPlatform AND (sysVersion.Major = 6) AND (sysVersion.Minor = 1) THEN
  BEGIN
    is_platform_windows_7 := TRUE;
  END ELSE
  BEGIN
    is_platform_windows_7 := FALSE;
  END;
END;

PROCEDURE CancelButtonClick(CurPageID : INTEGER; VAR Cancel, Confirm: BOOLEAN);
BEGIN
  Confirm := FALSE;
  messagebox_close.Center();
  messagebox_close.ShowModal();
  IF can_exit_setup THEN
  BEGIN
    ImgRelease(image_wizardform_background);
    ImgRelease(image_progressbar_background);
    ImgRelease(image_progressbar_foreground);
    ImgRelease(image_messagebox_background);
    gdipShutdown();
    messagebox_close.Release();
    WizardForm.Release();
    Cancel := TRUE;
  END ELSE
  BEGIN
    Cancel := FALSE;
  END;
END;

FUNCTION InitializeSetup() : BOOLEAN;
BEGIN
  IF is_installed_before() THEN
  BEGIN
    IF (version_installed_before > {#MyAppVersion}) THEN
    BEGIN
      MsgBox('您已安装更新版本的“{#MyAppName}”，不允许使用旧版本替换新版本，请单击“确定”按钮退出此安装程序。', mbInformation, MB_OK);
      Result := FALSE;
    END ELSE
    BEGIN
      Result := TRUE;
    END;
  END ELSE
  BEGIN
    Result := TRUE;
  END;
END;

PROCEDURE InitializeWizard();
BEGIN
  is_installer_initialized := TRUE;
  is_wizardform_show_normal := TRUE;
  is_wizardform_released := FALSE;
  determine_wether_is_windows_7_or_not();
  WizardForm.OuterNotebook.Hide;
  WizardForm.Bevel.Hide;
  WITH WizardForm DO
  BEGIN
    BorderStyle := bsNone;
    Position := poDesktopCenter;
    Width := WIZARDFORM_WIDTH_NORMAL;
    Height := WIZARDFORM_HEIGHT_MORE;
    Color := clWhite;
    NextButton.Height := 0;
    CancelButton.Height := 0;
    BackButton.Visible := FALSE;
  END;
  label_wizardform_title := TLabel.Create(WizardForm);
  WITH label_wizardform_title DO
  BEGIN
    Parent := WizardForm;
    AutoSize := FALSE;
    Left := 10;
    Top := 5;
    Width := 200;
    Height := 20;
    Font.Name := '微软雅黑';
    Font.Size := 9;
    Font.Color := clWhite;
    Caption := '{#MyAppName} V{#MyAppVersion} 安装';
    Transparent := TRUE;
    OnMouseDown := @wizardform_on_mouse_down;
  END;
  label_wizardform_more_product_already_installed := TLabel.Create(WizardForm);
  WITH label_wizardform_more_product_already_installed DO
  BEGIN
    Parent := WizardForm;
    AutoSize := FALSE;
    Left := 85;
    Top := 449;
    Width := 200;
    Height := 20;
    Font.Name := '微软雅黑';
    Font.Size := 9;
    Font.Color := clGray;
    Caption := '软件已经安装，不允许更换目录。';
    Transparent := TRUE;
    OnMouseDown := @wizardform_on_mouse_down;
  END;
  label_wizardform_more_product_already_installed.Hide;
  label_wizardform_main := TLabel.Create(WizardForm);
  WITH label_wizardform_main DO
  BEGIN
    Parent := WizardForm;
    AutoSize := FALSE;
    Left := 0;
    Top := 0;
    Width := WizardForm.Width;
    Height := WizardForm.Height;
    Caption := '';
    Transparent := TRUE;
    OnMouseDown := @wizardform_on_mouse_down;
  END;
  edit_target_path:= TEdit.Create(WizardForm);
  WITH edit_target_path DO
  BEGIN
    Parent := WizardForm;
    Text := WizardForm.DirEdit.Text;
    Font.Name := '微软雅黑';
    Font.Size := 9;
    BorderStyle := bsNone;
    SetBounds(91,423,402,20);
    OnChange := @edit_target_path_on_change;
    Color := clWhite;
    TabStop := FALSE;
  END;
  edit_target_path.Hide;
  ExtractTemporaryFile('button_customize_setup.png');
  ExtractTemporaryFile('button_uncustomize_setup.png');
  ExtractTemporaryFile('button_finish.png');
  ExtractTemporaryFile('button_setup_or_next.png');
  ExtractTemporaryFile('background_welcome.png');
  ExtractTemporaryFile('background_welcome_more.png');
  ExtractTemporaryFile('button_browse.png');
  ExtractTemporaryFile('progressbar_background.png');
  ExtractTemporaryFile('progressbar_foreground.png');
  ExtractTemporaryFile('button_license.png');
  ExtractTemporaryFile('checkbox_license.png');
  ExtractTemporaryFile('checkbox_setdefault.png');
  ExtractTemporaryFile('background_installing.png');
  ExtractTemporaryFile('background_finish.png');
  ExtractTemporaryFile('button_close.png');
  ExtractTemporaryFile('button_minimize.png');
  ExtractTemporaryFile('background_messagebox.png');
  ExtractTemporaryFile('button_cancel.png');
  ExtractTemporaryFile('button_ok.png');
  button_close := BtnCreate(WizardForm.Handle, 570, 0, 30, 30, ExpandConstant('{tmp}\button_close.png'), 0, FALSE);
  BtnSetEvent(button_close, ID_BUTTON_ON_CLICK_EVENT, WrapBtnCallback(@button_close_on_click, 1));
  button_minimize := BtnCreate(WizardForm.Handle, 540, 0, 30, 30, ExpandConstant('{tmp}\button_minimize.png'), 0, FALSE);
  BtnSetEvent(button_minimize, ID_BUTTON_ON_CLICK_EVENT, WrapBtnCallback(@button_minimize_on_click, 1));
  button_setup_or_next := BtnCreate(WizardForm.Handle, 211, 305, 178, 43, ExpandConstant('{tmp}\button_setup_or_next.png'), 0, FALSE);
  BtnSetEvent(button_setup_or_next, ID_BUTTON_ON_CLICK_EVENT, WrapBtnCallback(@button_setup_or_next_on_click, 1));
  button_browse := BtnCreate(WizardForm.Handle, 506, 420, 75, 24, ExpandConstant('{tmp}\button_browse.png'), 0, FALSE);
  BtnSetEvent(button_browse, ID_BUTTON_ON_CLICK_EVENT, WrapBtnCallback(@button_browse_on_click, 1));
  BtnSetVisibility(button_browse, FALSE);
  button_customize_setup := BtnCreate(WizardForm.Handle, 511, 374, 78, 14, ExpandConstant('{tmp}\button_customize_setup.png'), 0, FALSE);
  BtnSetEvent(button_customize_setup, ID_BUTTON_ON_CLICK_EVENT, WrapBtnCallback(@button_customize_setup_on_click, 1));
  button_uncustomize_setup := BtnCreate(WizardForm.Handle, 511, 374, 78, 14, ExpandConstant('{tmp}\button_uncustomize_setup.png'), 0, FALSE);
  BtnSetEvent(button_uncustomize_setup, ID_BUTTON_ON_CLICK_EVENT, WrapBtnCallback(@button_customize_setup_on_click, 1));
  BtnSetVisibility(button_uncustomize_setup, FALSE);
  PBOldProc := SetWindowLong(WizardForm.ProgressGauge.Handle, -4, PBCallBack(@PBProc, 4));
  ImgApplyChanges(WizardForm.Handle);
  messagebox_close := CreateCustomForm();
  WITH messagebox_close DO
  BEGIN
    BorderStyle := bsNone;
    Width := 380;
    Height := 190;
    Color := clWhite;
    Caption := '退出安装向导';
  END;
  label_messagebox_title := TLabel.Create(messagebox_close);
  WITH label_messagebox_title DO
  BEGIN
    Parent := messagebox_close;
    AutoSize := FALSE;
    Left := 30;
    Top := 5;
    Width := 400;
    Height := 20;
    Font.Name := '微软雅黑';
    Font.Size := 10;
    Font.Color := clWhite;
    Caption := '{#MyAppName}';
    Transparent := TRUE;
    OnMouseDown := @messagebox_on_mouse_down;
  END;
  label_messagebox_information := TLabel.Create(messagebox_close);
  WITH label_messagebox_information DO
  BEGIN
    Parent := messagebox_close;
    AutoSize := FALSE;
    Left := 70;
    Top := 64;
    Width := 400;
    Height := 20;
    Font.Name := '微软雅黑';
    Font.Size := 10;
    Font.Color := clBlack;
    Caption := '您确定要退出“{#MyAppName}”安装程序？';
    Transparent := TRUE;
    OnMouseDown := @messagebox_on_mouse_down;
  END;
  label_messagebox_main := TLabel.Create(messagebox_close);
  WITH label_messagebox_main DO
  BEGIN
    Parent := messagebox_close;
    AutoSize := FALSE;
    Left := 0;
    Top := 0;
    Width := messagebox_close.Width;
    Height := messagebox_close.Height;
    Caption := '';
    Transparent := TRUE;
    OnMouseDown := @messagebox_on_mouse_down;
  END;
  image_messagebox_background := ImgLoad(messagebox_close.Handle, ExpandConstant('{tmp}\background_messagebox.png'), 0, 0, 380, 190, FALSE, TRUE);
  button_messagebox_close := BtnCreate(messagebox_close.Handle, 350, 0, 30, 30, ExpandConstant('{tmp}\button_close.png'), 0, FALSE);
  BtnSetEvent(button_messagebox_close, ID_BUTTON_ON_CLICK_EVENT, WrapBtnCallback(@button_messagebox_cancel_on_click, 1));
  button_messagebox_ok := BtnCreate(messagebox_close.Handle, 206, 150, 76, 28, ExpandConstant('{tmp}\button_ok.png'), 0, FALSE);
  BtnSetEvent(button_messagebox_ok, ID_BUTTON_ON_CLICK_EVENT, WrapBtnCallback(@button_messagebox_ok_on_click, 1));
  button_messagebox_cancel := BtnCreate(messagebox_close.Handle, 293, 150, 76, 28, ExpandConstant('{tmp}\button_cancel.png'), 0, FALSE);
  BtnSetEvent(button_messagebox_cancel, ID_BUTTON_ON_CLICK_EVENT, WrapBtnCallback(@button_messagebox_cancel_on_click, 1));
  ImgApplyChanges(messagebox_close.Handle);
END;

PROCEDURE DeinitializeSetup();
BEGIN
  IF ((is_wizardform_released = FALSE) AND (can_exit_setup = FALSE)) THEN
  BEGIN
    gdipShutdown();
    IF is_installer_initialized THEN
    BEGIN
      ImgRelease(image_wizardform_background);
      ImgRelease(image_progressbar_background);
      ImgRelease(image_progressbar_foreground);
      ImgRelease(image_messagebox_background);
      gdipShutdown();
      messagebox_close.Release();
      WizardForm.Release();
    END;
  END;
END;

PROCEDURE CurPageChanged(CurPageID : INTEGER);
BEGIN
  IF (CurPageID = wpWelcome) THEN
  BEGIN
    image_wizardform_background := ImgLoad(WizardForm.Handle, ExpandConstant('{tmp}\background_welcome.png'), 0, 0, WIZARDFORM_WIDTH_NORMAL, WIZARDFORM_HEIGHT_NORMAL, FALSE, TRUE);
    button_license := BtnCreate(WizardForm.Handle, 110, 376, 96, 12, ExpandConstant('{tmp}\button_license.png'), 0, FALSE);
    BtnSetEvent(button_license, ID_BUTTON_ON_CLICK_EVENT, WrapBtnCallback(@button_license_on_click, 1));
    checkbox_license := BtnCreate(WizardForm.Handle, 11, 374, 93, 17, ExpandConstant('{tmp}\checkbox_license.png'), 0, TRUE);
    BtnSetEvent(checkbox_license, ID_BUTTON_ON_CLICK_EVENT, WrapBtnCallback(@checkbox_license_on_click, 1));
    BtnSetChecked(checkbox_license, TRUE);
    checkbox_setdefault := BtnCreate(WizardForm.Handle, 85, 470, 92, 17, ExpandConstant('{tmp}\checkbox_setdefault.png'), 0, TRUE);
    BtnSetEvent(checkbox_setdefault, ID_BUTTON_ON_CLICK_EVENT, WrapBtnCallback(@checkbox_setdefault_on_click, 1));
    BtnSetChecked(checkbox_setdefault, TRUE);
    BtnSetVisibility(checkbox_setdefault, FALSE);
    WizardForm.Height := WIZARDFORM_HEIGHT_NORMAL;
    ImgApplyChanges(WizardForm.Handle);
  END;
  IF (CurPageID = wpInstalling) THEN
  BEGIN
    edit_target_path.Hide;
    label_wizardform_more_product_already_installed.Hide;
    BtnSetVisibility(button_browse, FALSE);
    WizardForm.Height := WIZARDFORM_HEIGHT_NORMAL;
    is_wizardform_show_normal := TRUE;
    BtnSetVisibility(button_customize_setup, FALSE);
    BtnSetVisibility(button_uncustomize_setup, FALSE);
    BtnSetVisibility(checkbox_setdefault, FALSE);
    BtnSetVisibility(button_license, FALSE);
    BtnSetVisibility(checkbox_license, FALSE);
    image_wizardform_background := ImgLoad(WizardForm.Handle, ExpandConstant('{tmp}\background_installing.png'), 0, 0, WIZARDFORM_WIDTH_NORMAL, WIZARDFORM_HEIGHT_NORMAL, FALSE, TRUE);
    image_progressbar_background := ImgLoad(WizardForm.Handle, ExpandConstant('{tmp}\progressbar_background.png'), 20, 374, 560, 6, FALSE, TRUE);
    image_progressbar_foreground := ImgLoad(WizardForm.Handle, ExpandConstant('{tmp}\progressbar_foreground.png'), 20, 374, 0, 0, TRUE, TRUE);
    BtnSetVisibility(button_setup_or_next, FALSE);
    ImgApplyChanges(WizardForm.Handle);
  END;
  IF (CurPageID = wpFinished) THEN
  BEGIN
    ImgSetVisibility(image_progressbar_background, FALSE);
    ImgSetVisibility(image_progressbar_foreground, FALSE);
    button_setup_or_next := BtnCreate(WizardForm.Handle, 214, 305, 180, 44, ExpandConstant('{tmp}\button_finish.png'), 0, FALSE);
    BtnSetEvent(button_setup_or_next, ID_BUTTON_ON_CLICK_EVENT, WrapBtnCallback(@button_setup_or_next_on_click, 1));
    BtnSetEvent(button_close, ID_BUTTON_ON_CLICK_EVENT, WrapBtnCallback(@button_setup_or_next_on_click, 1));
    image_wizardform_background := ImgLoad(WizardForm.Handle, ExpandConstant('{tmp}\background_finish.png'), 0, 0, WIZARDFORM_WIDTH_NORMAL, WIZARDFORM_HEIGHT_NORMAL, FALSE, TRUE);
    ImgApplyChanges(WizardForm.Handle);
  END;
END;

PROCEDURE CurStepChanged(CurStep : TSetupStep);
BEGIN
  IF (CurStep = ssPostInstall) THEN
  BEGIN
    check_if_need_change_associations();
    //AND DO OTHER THINGS
  END;
  IF (CurStep = ssDone) THEN
  BEGIN
    is_wizardform_released := TRUE;
    ImgRelease(image_wizardform_background);
    ImgRelease(image_progressbar_background);
    ImgRelease(image_progressbar_foreground);
    ImgRelease(image_messagebox_background);
    gdipShutdown();
    messagebox_close.Release();
    WizardForm.Release();
  END;
END;

FUNCTION ShouldSkipPage(PageID : INTEGER) : BOOLEAN;
BEGIN
  IF (PageID = wpLicense) THEN Result := TRUE;
  IF (PageID = wpPassword) THEN Result := TRUE;
  IF (PageID = wpInfoBefore) THEN Result := TRUE;
  IF (PageID = wpUserInfo) THEN Result := TRUE;
  IF (PageID = wpSelectDir) THEN Result := TRUE;
  IF (PageID = wpSelectComponents) THEN Result := TRUE;
  IF (PageID = wpSelectProgramGroup) THEN Result := TRUE;
  IF (PageID = wpSelectTasks) THEN Result := TRUE;
  IF (PageID = wpReady) THEN Result := TRUE;
  IF (PageID = wpPreparing) THEN Result := TRUE;
  IF (PageID = wpInfoAfter) THEN Result := TRUE;
END;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;此脚本主要模仿并实现“好压”安装程序的界面                                                           ;
;请使用 Unicode 版 Inno Setup 5.5.9（或更新） 编译器编译                                            ;
;经测试，此脚本可以在官方原版编译器、SkyGZ增强版编译器和Restools增强版编译器上完美编译通过并正常运行;
;令人遗憾的是原始脚本作者已不可考                                                                   ;
;代码主要思路来源于：http://blog.csdn.net/oceanlucy/article/details/50033773                        ;
;感谢博主 “沉森心” （oceanlucy）                                                                    ;
;此脚本也经过了几个网友的改进，但已无法具体考证，但我仍然很感谢他们                                 ;
;最终版本由 “赵宇航”/“糖鸭君”/“糖鸭”/“唐雅”/“wangwenx190” 修改得到                                  ;
;欢迎大家传播和完善此脚本                                                                           ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

#IF VER < EncodeVer(5,5,9)
  #error 请升级您的 Inno Setup 编译器到 V5.5.9 或更新的版本
#endif

#ifndef UNICODE
  #error 请使用 Unicode 版 Inno Setup 编译器
#endif

#define MyAppID "{751134E2-9659-4800-B491-787AF330DAED}"
#define MyAppName "My Program"
#define MyAppVersion "1.5"
#define MyAppPublisher "My Company, Inc."
#define MyAppPublisherURL "http://www.example.com/"
#define MyAppSupportURL MyAppPublisherURL
#define MyAppUpdatesURL MyAppPublisherURL
#define MyAppComments "备注"
#define MyAppContact MyAppPublisher
#define MyAppSupportPhone "13510102020"
#define MyAppReadmeURL "https://github.com/wangwenx190/InternetFashionedInstaller/blob/master/README.md"
#define MyAppLicenseURL "https://github.com/wangwenx190/InternetFashionedInstaller/blob/master/LICENSE"
#define MyAppCopyrightYear "2017"
#define MyAppCopyright "版权所有 © " + MyAppCopyrightYear + ", " + MyAppPublisher
#define MyAppExeName "MyProg.exe"

[Setup]
AppId={{#MyAppID}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppPublisherURL}
AppSupportURL={#MyAppSupportURL}
AppUpdatesURL={#MyAppUpdatesURL}
AppComments={#MyAppComments}
AppContact={#MyAppContact}
AppSupportPhone={#MyAppSupportPhone}
AppReadmeFile={#MyAppReadmeURL}
AppCopyright={#MyAppCopyright}
DefaultDirName={pf}\{#MyAppPublisher}\{#MyAppName}
DefaultGroupName={#MyAppPublisher}\{#MyAppName}
OutputBaseFilename={#MyAppName}_{#MyAppVersion}_Setup
VersionInfoDescription={#MyAppName} 安装程序
VersionInfoProductName={#MyAppName}
VersionInfoCompany={#MyAppPublisher}
VersionInfoCopyright={#MyAppCopyright}
VersionInfoProductVersion={#MyAppVersion}
VersionInfoProductTextVersion={#MyAppVersion}
VersionInfoTextVersion={#MyAppVersion}
VersionInfoVersion={#MyAppVersion}
OutputDir=.\Output\
SetupIconFile=.\Setup.ico
Compression=lzma2/ultra64
InternalCompressLevel=ultra64
SolidCompression=yes
DisableProgramGroupPage=yes
DisableDirPage=yes
DisableReadyPage=yes
MinVersion=0,6.1.7601
TimeStampsInUTC=yes
Uninstallable=yes
SetupMutex={{#MyAppID}Installer,Global\{{#MyAppID}Installer
AppMutex={#MyAppName}
ShowLanguageDialog=no
UninstallDisplayName={#MyAppName}
UninstallDisplayIcon={uninstallexe},0
;ChangesAssociations=yes

[Languages]
Name: "zh_CN"; MessagesFile: ".\lang\zh-CN.isl"

[Files]
Source: ".\app\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: ".\tmp\botva2.dll"; DestDir: "{tmp}\botva2.dll"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\InnoCallback.dll"; DestDir: "{tmp}\InnoCallback.dll"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\background_finish.png"; DestDir: "{tmp}\background_finish.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\background_installing.png"; DestDir: "{tmp}\background_installing.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\background_messagebox.png"; DestDir: "{tmp}\background_messagebox.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\background_welcome.png"; DestDir: "{tmp}\background_welcome.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\background_welcome_more.png"; DestDir: "{tmp}\background_welcome_more.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\button_browse.png"; DestDir: "{tmp}\button_browse.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\button_cancel.png"; DestDir: "{tmp}\button_cancel.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\button_close.png"; DestDir: "{tmp}\button_close.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\button_customize_setup.png"; DestDir: "{tmp}\button_customize_setup.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\button_finish.png"; DestDir: "{tmp}\button_finish.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\button_license.png"; DestDir: "{tmp}\button_license.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\button_minimize.png"; DestDir: "{tmp}\button_minimize.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\button_ok.png"; DestDir: "{tmp}\button_ok.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\button_setup_or_next.png"; DestDir: "{tmp}\button_setup_or_next.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\button_uncustomize_setup.png"; DestDir: "{tmp}\button_uncustomize_setup.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\checkbox_license.png"; DestDir: "{tmp}\checkbox_license.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\checkbox_setdefault.png"; DestDir: "{tmp}\checkbox_setdefault.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\progressbar_background.png"; DestDir: "{tmp}\progressbar_background.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system
Source: ".\tmp\progressbar_foreground.png"; DestDir: "{tmp}\progressbar_foreground.png"; Flags: dontcopy solidbreak nocompression; Attribs: hidden system

;若有写入注册表条目的需要，请取消此区段的注释并自行添加相关脚本
;[Registry]
;Root: HKCU; Subkey: "Software\My Company"; Flags: uninsdeletekeyifempty
;Root: HKCU; Subkey: "Software\My Company\My Program"; Flags: uninsdeletekey
;Root: HKLM; Subkey: "Software\My Company"; Flags: uninsdeletekeyifempty
;Root: HKLM; Subkey: "Software\My Company\My Program"; Flags: uninsdeletekey
;Root: HKLM; Subkey: "Software\My Company\My Program\Settings"; ValueType: string; ValueName: "InstallPath"; ValueData: "{app}"

;若有创建快捷方式的需要，请取消此区段的注释并自行添加相关脚本
;[Icons]
;Name: "{group}\My Program"; Filename: "{app}\MYPROG.EXE"; Parameters: "/play filename.mid"; WorkingDir: "{app}"; Comment: "This is my program"; IconFilename: "{app}\myicon.ico"
;Name: "{group}\Documents"; Filename: "{app}\Doc"; Flags: foldershortcut

[UninstallDelete]
Type: filesandordirs; Name: "{app}"

[Code]
CONST
  PRODUCT_REGISTRY_KEY_32 = 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#MyAppID}_is1';
  PRODUCT_REGISTRY_KEY_64 = 'SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{#MyAppID}_is1';
  WM_SYSCOMMAND = $0112;
  ID_BUTTON_ON_CLICK_EVENT = 1;
  WIZARDFORM_WIDTH_NORMAL = 600;
  WIZARDFORM_HEIGHT_NORMAL = 400;
  WIZARDFORM_HEIGHT_MORE = 503;

VAR
  label_wizardform_main, label_messagebox_main, label_wizardform_more_product_already_installed, label_messagebox_information, label_messagebox_title : TLabel;
  image_wizardform_background, image_messagebox_background, image_progressbar_background, image_progressbar_foreground, PBOldProc : LONGINT;
  button_license, button_minimize, button_close, button_browse, button_setup_or_next, button_customize_setup, button_uncustomize_setup, checkbox_license, checkbox_setdefault, button_messagebox_close, button_messagebox_ok, button_messagebox_cancel : HWND;
  is_wizardform_show_normal, is_installer_initialized, is_platform_windows_7, is_wizardform_released, can_exit_setup : BOOLEAN;
  edit_target_path : TEdit;
  version_installed_before : EXTENDED;
  messagebox_close : TSetupForm;

TYPE
  TBtnEventProc = PROCEDURE(h : HWND);
  TPBProc = FUNCTION(h : hWnd; Msg, wParam, lParam : LONGINT) : LONGINT;

FUNCTION  ImgLoad(h : HWND; FileName : PAnsiChar; Left, Top, Width, Height : INTEGER; Stretch, IsBkg : BOOLEAN) : LONGINT; EXTERNAL 'ImgLoad@files:botva2.dll STDCALL DELAYLOAD';
PROCEDURE ImgSetVisibility(img : LONGINT; Visible : BOOLEAN); EXTERNAL 'ImgSetVisibility@files:botva2.dll STDCALL DELAYLOAD';
PROCEDURE ImgApplyChanges(h : HWND); EXTERNAL 'ImgApplyChanges@files:botva2.dll STDCALL DELAYLOAD';
PROCEDURE ImgSetPosition(img : LONGINT; NewLeft, NewTop, NewWidth, NewHeight : INTEGER); EXTERNAL 'ImgSetPosition@files:botva2.dll STDCALL DELAYLOAD';
PROCEDURE ImgRelease(img : LONGINT); EXTERNAL 'ImgRelease@files:botva2.dll STDCALL DELAYLOAD';
PROCEDURE CreateFormFromImage(h : HWND; FileName : PAnsiChar); EXTERNAL 'CreateFormFromImage@files:botva2.dll STDCALL DELAYLOAD';
PROCEDURE gdipShutdown();  EXTERNAL 'gdipShutdown@files:botva2.dll STDCALL DELAYLOAD';
FUNCTION  WrapBtnCallback(Callback : TBtnEventProc; ParamCount : INTEGER) : LONGWORD; EXTERNAL 'wrapcallback@files:innocallback.dll STDCALL DELAYLOAD';
FUNCTION  BtnCreate(hParent : HWND; Left, Top, Width, Height : INTEGER; FileName : PAnsiChar; ShadowWidth : INTEGER; IsCheckBtn : BOOLEAN) : HWND;  EXTERNAL 'BtnCreate@files:botva2.dll STDCALL DELAYLOAD';
PROCEDURE BtnSetVisibility(h : HWND; Value : BOOLEAN); EXTERNAL 'BtnSetVisibility@files:botva2.dll STDCALL DELAYLOAD';
PROCEDURE BtnSetEvent(h : HWND; EventID : INTEGER; Event : LONGWORD); EXTERNAL 'BtnSetEvent@files:botva2.dll STDCALL DELAYLOAD';
PROCEDURE BtnSetEnabled(h : HWND; Value : BOOLEAN); EXTERNAL 'BtnSetEnabled@files:botva2.dll STDCALL DELAYLOAD';
FUNCTION  BtnGetChecked(h : HWND) : BOOLEAN; EXTERNAL 'BtnGetChecked@files:botva2.dll STDCALL DELAYLOAD';
PROCEDURE BtnSetChecked(h : HWND; Value : BOOLEAN); EXTERNAL 'BtnSetChecked@files:botva2.dll STDCALL DELAYLOAD';
PROCEDURE BtnSetPosition(h : HWND; NewLeft, NewTop, NewWidth, NewHeight : INTEGER);  EXTERNAL 'BtnSetPosition@files:botva2.dll STDCALL DELAYLOAD';
FUNCTION  SetWindowLong(h : HWnd; Index : INTEGER; NewLong : LONGINT) : LONGINT; EXTERNAL 'SetWindowLongA@user32.dll STDCALL';
FUNCTION  PBCallBack(P : TPBProc; ParamCount : INTEGER) : LONGWORD; EXTERNAL 'wrapcallback@files:innocallback.dll STDCALL DELAYLOAD';
FUNCTION  CallWindowProc(lpPrevWndFunc : LONGINT; h : HWND; Msg : UINT; wParam, lParam : LONGINT) : LONGINT; EXTERNAL 'CallWindowProcA@user32.dll STDCALL';
PROCEDURE ImgSetVisiblePart(img : LONGINT; NewLeft, NewTop, NewWidth, NewHeight : INTEGER); EXTERNAL 'ImgSetVisiblePart@files:botva2.dll STDCALL DELAYLOAD';
FUNCTION  ReleaseCapture() : LONGINT; EXTERNAL 'ReleaseCapture@user32.dll STDCALL';
FUNCTION  CreateRoundRectRgn(p1, p2, p3, p4, p5, p6 : INTEGER) : THandle; EXTERNAL 'CreateRoundRectRgn@gdi32 STDCALL';
FUNCTION  SetWindowRgn(h : HWND; hRgn : THandle; bRedraw : BOOLEAN) : INTEGER; EXTERNAL 'SetWindowRgn@user32 STDCALL';

//调用这个函数可以使矩形窗口转变为圆角矩形窗口
PROCEDURE shape_form_round(aForm : TForm; edgeSize : INTEGER);
VAR
  FormRegion : LONGWORD;
BEGIN
  FormRegion := CreateRoundRectRgn(0, 0, aForm.Width, aForm.Height, edgeSize, edgeSize);
  SetWindowRgn(aForm.Handle, FormRegion, TRUE);
END;

FUNCTION is_installed_before() : BOOLEAN;
VAR
  oldVersion : STRING;
BEGIN
  IF is_platform_windows_7 THEN
  BEGIN
    IF IsWin64 THEN
    BEGIN
      IF RegKeyExists(HKEY_LOCAL_MACHINE, PRODUCT_REGISTRY_KEY_64) THEN
      BEGIN
        RegQueryStringValue(HKEY_LOCAL_MACHINE, PRODUCT_REGISTRY_KEY_64, 'DisplayVersion', oldVersion);
        version_installed_before := StrToFloat(oldVersion);
        Result := TRUE;
      END ELSE
      BEGIN
        version_installed_before := 0.0;
        Result := FALSE;
      END;
    END ELSE
    BEGIN
      IF RegKeyExists(HKEY_LOCAL_MACHINE, PRODUCT_REGISTRY_KEY_32) THEN
      BEGIN
        RegQueryStringValue(HKEY_LOCAL_MACHINE, PRODUCT_REGISTRY_KEY_32, 'DisplayVersion', oldVersion);
        version_installed_before := StrToFloat(oldVersion);
        Result := TRUE;
      END ELSE
      BEGIN
        version_installed_before := 0.0;
        Result := FALSE;
      END;
    END;
  END ELSE
  BEGIN
    IF RegKeyExists(HKEY_LOCAL_MACHINE, PRODUCT_REGISTRY_KEY_32) THEN
      BEGIN
        RegQueryStringValue(HKEY_LOCAL_MACHINE, PRODUCT_REGISTRY_KEY_32, 'DisplayVersion', oldVersion);
        version_installed_before := StrToFloat(oldVersion);
        Result := TRUE;
      END ELSE
      BEGIN
        version_installed_before := 0.0;
        Result := FALSE;
      END;
  END;
END;

PROCEDURE button_close_on_click(hBtn : HWND);
BEGIN
  WizardForm.CancelButton.OnClick(WizardForm);
END;

PROCEDURE button_minimize_on_click(hBtn : HWND);
BEGIN
  SendMessage(WizardForm.Handle, WM_SYSCOMMAND, 61472, 0);
END;

PROCEDURE button_customize_setup_on_click(hBtn : HWND);
BEGIN
  IF is_wizardform_show_normal THEN
  BEGIN
    WizardForm.Height := WIZARDFORM_HEIGHT_MORE;
    image_wizardform_background := ImgLoad(WizardForm.Handle, ExpandConstant('{tmp}\background_welcome_more.png'), 0, 0, WIZARDFORM_WIDTH_NORMAL, WIZARDFORM_HEIGHT_MORE, FALSE, TRUE);
    edit_target_path.Show;
    BtnSetVisibility(button_browse, TRUE);
    BtnSetVisibility(checkbox_setdefault, TRUE);
    BtnSetVisibility(button_customize_setup, FALSE);
    BtnSetVisibility(button_uncustomize_setup, TRUE);
    IF is_installed_before() THEN
    BEGIN
      edit_target_path.Enabled := FALSE;
      BtnSetEnabled(button_browse, FALSE);
      label_wizardform_more_product_already_installed.Show;
    END;
    is_wizardform_show_normal := FALSE;
  END ELSE
  BEGIN
    edit_target_path.Hide;
    label_wizardform_more_product_already_installed.Hide;
    BtnSetVisibility(button_browse, FALSE);
    BtnSetVisibility(checkbox_setdefault, FALSE);
    WizardForm.Height := WIZARDFORM_HEIGHT_NORMAL;
    image_wizardform_background := ImgLoad(WizardForm.Handle, ExpandConstant('{tmp}\background_welcome.png'), 0, 0, WIZARDFORM_WIDTH_NORMAL, WIZARDFORM_HEIGHT_NORMAL, FALSE, TRUE);
    BtnSetVisibility(button_customize_setup, TRUE);
    BtnSetVisibility(button_uncustomize_setup, FALSE);
    is_wizardform_show_normal := TRUE;
  END;
  ImgApplyChanges(WizardForm.Handle);
END;

PROCEDURE button_browse_on_click(hBtn : HWND);
BEGIN
  WizardForm.DirBrowseButton.OnClick(WizardForm);
  edit_target_path.Text := WizardForm.DirEdit.Text;
END;

PROCEDURE edit_target_path_on_change(Sender : TObject);
BEGIN
  WizardForm.DirEdit.Text := edit_target_path.Text;
END;

PROCEDURE checkbox_license_on_click(hBtn : HWND);
BEGIN
    IF BtnGetChecked(checkbox_license) THEN
    BEGIN
      BtnSetEnabled(button_setup_or_next, TRUE);
    END ELSE
    BEGIN
      BtnSetEnabled(button_setup_or_next, FALSE);
    END;
END;

PROCEDURE checkbox_setdefault_on_click(hBtn : HWND);
BEGIN
  //TODO
END;

FUNCTION is_setdefault_checkbox_checked() : BOOLEAN;
BEGIN
  Result := BtnGetChecked(checkbox_setdefault);
END;

PROCEDURE check_if_need_change_associations();
BEGIN
  IF is_setdefault_checkbox_checked() THEN
  BEGIN
    //TODO
  END;
END;

PROCEDURE button_setup_or_next_on_click(hBtn : HWND);
BEGIN
  WizardForm.NextButton.OnClick(WizardForm);
END;

FUNCTION PBProc(h : hWnd; Msg, wParam, lParam : LONGINT) : LONGINT;
VAR
  pr, i1, i2 : EXTENDED;
  w : INTEGER;
BEGIN
  Result := CallWindowProc(PBOldProc, h, Msg, wParam, lParam);
  IF ((Msg = $402) AND (WizardForm.ProgressGauge.Position > WizardForm.ProgressGauge.Min)) THEN
  BEGIN
    i1 := WizardForm.ProgressGauge.Position - WizardForm.ProgressGauge.Min;
    i2 := WizardForm.ProgressGauge.Max - WizardForm.ProgressGauge.Min;
    pr := i1 * 100 / i2;
    w := Round(560 * pr / 100);
    ImgSetPosition(image_progressbar_foreground, 20, 374, w, 6);
    ImgSetVisiblePart(image_progressbar_foreground, 0, 0, w, 6);
    ImgApplyChanges(WizardForm.Handle);
  END;
END;

PROCEDURE button_license_on_click(hBtn : HWND);
VAR
  ErrorCode : INTEGER;
BEGIN
  ShellExec('', '{#MyAppLicenseURL}', '', '', SW_SHOW, ewNoWait, ErrorCode);
END;

PROCEDURE button_messagebox_ok_on_click(hBtn : HWND);
BEGIN
  can_exit_setup := TRUE;
  messagebox_close.Close();
END;

PROCEDURE button_messagebox_cancel_on_click(hBtn : HWND);
BEGIN
  can_exit_setup := FALSE;
  messagebox_close.Close();
END;

PROCEDURE wizardform_on_mouse_down(Sender : TObject; Button : TMouseButton; Shift : TShiftState; X, Y : INTEGER);
BEGIN
  ReleaseCapture();
  SendMessage(WizardForm.Handle, WM_SYSCOMMAND, $F012, 0);
END;

PROCEDURE messagebox_on_mouse_down(Sender : TObject; Button : TMouseButton; Shift : TShiftState; X, Y : INTEGER);
BEGIN
  ReleaseCapture();
  SendMessage(messagebox_close.Handle, WM_SYSCOMMAND, $F012, 0);
END;

PROCEDURE determine_wether_is_windows_7_or_not();
VAR
  sysVersion : TWindowsVersion;
BEGIN
  GetWindowsVersionEx(sysVersion);
  IF sysVersion.NTPlatform AND (sysVersion.Major = 6) AND (sysVersion.Minor = 1) THEN
  BEGIN
    is_platform_windows_7 := TRUE;
  END ELSE
  BEGIN
    is_platform_windows_7 := FALSE;
  END;
END;

PROCEDURE CancelButtonClick(CurPageID : INTEGER; VAR Cancel, Confirm: BOOLEAN);
BEGIN
  Confirm := FALSE;
  messagebox_close.Center();
  messagebox_close.ShowModal();
  IF can_exit_setup THEN
  BEGIN
    ImgRelease(image_wizardform_background);
    ImgRelease(image_progressbar_background);
    ImgRelease(image_progressbar_foreground);
    ImgRelease(image_messagebox_background);
    gdipShutdown();
    messagebox_close.Release();
    WizardForm.Release();
    Cancel := TRUE;
  END ELSE
  BEGIN
    Cancel := FALSE;
  END;
END;

FUNCTION InitializeSetup() : BOOLEAN;
BEGIN
  IF is_installed_before() THEN
  BEGIN
    IF (version_installed_before > {#MyAppVersion}) THEN
    BEGIN
      MsgBox('您已安装更新版本的“{#MyAppName}”，不允许使用旧版本替换新版本，请单击“确定”按钮退出此安装程序。', mbInformation, MB_OK);
      Result := FALSE;
    END ELSE
    BEGIN
      Result := TRUE;
    END;
  END ELSE
  BEGIN
    Result := TRUE;
  END;
END;

PROCEDURE InitializeWizard();
BEGIN
  is_installer_initialized := TRUE;
  is_wizardform_show_normal := TRUE;
  is_wizardform_released := FALSE;
  determine_wether_is_windows_7_or_not();
  WizardForm.OuterNotebook.Hide;
  WizardForm.Bevel.Hide;
  WITH WizardForm DO
  BEGIN
    BorderStyle := bsNone;
    Position := poDesktopCenter;
    Width := WIZARDFORM_WIDTH_NORMAL;
    Height := WIZARDFORM_HEIGHT_MORE;
    Color := clWhite;
    NextButton.Height := 0;
    CancelButton.Height := 0;
    BackButton.Visible := FALSE;
  END;
  label_wizardform_more_product_already_installed := TLabel.Create(WizardForm);
  WITH label_wizardform_more_product_already_installed DO
  BEGIN
    Parent := WizardForm;
    AutoSize := FALSE;
    Left := 85;
    Top := 449;
    Width := 200;
    Height := 20;
    Font.Name := '微软雅黑';
    Font.Size := 9;
    Font.Color := clGray;
    Caption := '软件已经安装，不允许更换目录。';
    Transparent := TRUE;
    OnMouseDown := @wizardform_on_mouse_down;
  END;
  label_wizardform_more_product_already_installed.Hide;
  label_wizardform_main := TLabel.Create(WizardForm);
  WITH label_wizardform_main DO
  BEGIN
    Parent := WizardForm;
    AutoSize := FALSE;
    Left := 0;
    Top := 0;
    Width := WizardForm.Width;
    Height := WizardForm.Height;
    Caption := '';
    Transparent := TRUE;
    OnMouseDown := @wizardform_on_mouse_down;
  END;
  edit_target_path:= TEdit.Create(WizardForm);
  WITH edit_target_path DO
  BEGIN
    Parent := WizardForm;
    Text := WizardForm.DirEdit.Text;
    Font.Name := '微软雅黑';
    Font.Size := 9;
    BorderStyle := bsNone;
    SetBounds(91,423,402,20);
    OnChange := @edit_target_path_on_change;
    Color := clWhite;
    TabStop := FALSE;
  END;
  edit_target_path.Hide;
  ExtractTemporaryFile('button_customize_setup.png');
  ExtractTemporaryFile('button_uncustomize_setup.png');
  ExtractTemporaryFile('button_finish.png');
  ExtractTemporaryFile('button_setup_or_next.png');
  ExtractTemporaryFile('background_welcome.png');
  ExtractTemporaryFile('background_welcome_more.png');
  ExtractTemporaryFile('button_browse.png');
  ExtractTemporaryFile('progressbar_background.png');
  ExtractTemporaryFile('progressbar_foreground.png');
  ExtractTemporaryFile('button_license.png');
  ExtractTemporaryFile('checkbox_license.png');
  ExtractTemporaryFile('checkbox_setdefault.png');
  ExtractTemporaryFile('background_installing.png');
  ExtractTemporaryFile('background_finish.png');
  ExtractTemporaryFile('button_close.png');
  ExtractTemporaryFile('button_minimize.png');
  ExtractTemporaryFile('background_messagebox.png');
  ExtractTemporaryFile('button_cancel.png');
  ExtractTemporaryFile('button_ok.png');
  button_close := BtnCreate(WizardForm.Handle, 570, 0, 30, 30, ExpandConstant('{tmp}\button_close.png'), 0, FALSE);
  BtnSetEvent(button_close, ID_BUTTON_ON_CLICK_EVENT, WrapBtnCallback(@button_close_on_click, 1));
  button_minimize := BtnCreate(WizardForm.Handle, 540, 0, 30, 30, ExpandConstant('{tmp}\button_minimize.png'), 0, FALSE);
  BtnSetEvent(button_minimize, ID_BUTTON_ON_CLICK_EVENT, WrapBtnCallback(@button_minimize_on_click, 1));
  button_setup_or_next := BtnCreate(WizardForm.Handle, 211, 305, 178, 43, ExpandConstant('{tmp}\button_setup_or_next.png'), 0, FALSE);
  BtnSetEvent(button_setup_or_next, ID_BUTTON_ON_CLICK_EVENT, WrapBtnCallback(@button_setup_or_next_on_click, 1));
  button_browse := BtnCreate(WizardForm.Handle, 506, 420, 75, 24, ExpandConstant('{tmp}\button_browse.png'), 0, FALSE);
  BtnSetEvent(button_browse, ID_BUTTON_ON_CLICK_EVENT, WrapBtnCallback(@button_browse_on_click, 1));
  BtnSetVisibility(button_browse, FALSE);
  button_customize_setup := BtnCreate(WizardForm.Handle, 511, 374, 78, 14, ExpandConstant('{tmp}\button_customize_setup.png'), 0, FALSE);
  BtnSetEvent(button_customize_setup, ID_BUTTON_ON_CLICK_EVENT, WrapBtnCallback(@button_customize_setup_on_click, 1));
  button_uncustomize_setup := BtnCreate(WizardForm.Handle, 511, 374, 78, 14, ExpandConstant('{tmp}\button_uncustomize_setup.png'), 0, FALSE);
  BtnSetEvent(button_uncustomize_setup, ID_BUTTON_ON_CLICK_EVENT, WrapBtnCallback(@button_customize_setup_on_click, 1));
  BtnSetVisibility(button_uncustomize_setup, FALSE);
  PBOldProc := SetWindowLong(WizardForm.ProgressGauge.Handle, -4, PBCallBack(@PBProc, 4));
  ImgApplyChanges(WizardForm.Handle);
  messagebox_close := CreateCustomForm();
  WITH messagebox_close DO
  BEGIN
    BorderStyle := bsNone;
    Width := 380;
    Height := 190;
    Color := clWhite;
    Caption := '退出安装向导';
  END;
  label_messagebox_title := TLabel.Create(messagebox_close);
  WITH label_messagebox_title DO
  BEGIN
    Parent := messagebox_close;
    AutoSize := FALSE;
    Left := 30;
    Top := 5;
    Width := 400;
    Height := 20;
    Font.Name := '微软雅黑';
    Font.Size := 10;
    Font.Color := clWhite;
    Caption := '{#MyAppName}';
    Transparent := TRUE;
    OnMouseDown := @messagebox_on_mouse_down;
  END;
  label_messagebox_information := TLabel.Create(messagebox_close);
  WITH label_messagebox_information DO
  BEGIN
    Parent := messagebox_close;
    AutoSize := FALSE;
    Left := 70;
    Top := 64;
    Width := 400;
    Height := 20;
    Font.Name := '微软雅黑';
    Font.Size := 10;
    Font.Color := clBlack;
    Caption := '您确定要退出“{#MyAppName}”安装程序？';
    Transparent := TRUE;
    OnMouseDown := @messagebox_on_mouse_down;
  END;
  label_messagebox_main := TLabel.Create(messagebox_close);
  WITH label_messagebox_main DO
  BEGIN
    Parent := messagebox_close;
    AutoSize := FALSE;
    Left := 0;
    Top := 0;
    Width := messagebox_close.Width;
    Height := messagebox_close.Height;
    Caption := '';
    Transparent := TRUE;
    OnMouseDown := @messagebox_on_mouse_down;
  END;
  image_messagebox_background := ImgLoad(messagebox_close.Handle, ExpandConstant('{tmp}\background_messagebox.png'), 0, 0, 380, 190, FALSE, TRUE);
  button_messagebox_close := BtnCreate(messagebox_close.Handle, 350, 0, 30, 30, ExpandConstant('{tmp}\button_close.png'), 0, FALSE);
  BtnSetEvent(button_messagebox_close, ID_BUTTON_ON_CLICK_EVENT, WrapBtnCallback(@button_messagebox_cancel_on_click, 1));
  button_messagebox_ok := BtnCreate(messagebox_close.Handle, 206, 150, 76, 28, ExpandConstant('{tmp}\button_ok.png'), 0, FALSE);
  BtnSetEvent(button_messagebox_ok, ID_BUTTON_ON_CLICK_EVENT, WrapBtnCallback(@button_messagebox_ok_on_click, 1));
  button_messagebox_cancel := BtnCreate(messagebox_close.Handle, 293, 150, 76, 28, ExpandConstant('{tmp}\button_cancel.png'), 0, FALSE);
  BtnSetEvent(button_messagebox_cancel, ID_BUTTON_ON_CLICK_EVENT, WrapBtnCallback(@button_messagebox_cancel_on_click, 1));
  ImgApplyChanges(messagebox_close.Handle);
END;

PROCEDURE DeinitializeSetup();
BEGIN
  IF ((is_wizardform_released = FALSE) AND (can_exit_setup = FALSE)) THEN
  BEGIN
    gdipShutdown();
    IF is_installer_initialized THEN
    BEGIN
      WizardForm.Release();
    END;
  END;
END;

PROCEDURE CurPageChanged(CurPageID : INTEGER);
BEGIN
  IF (CurPageID = wpWelcome) THEN
  BEGIN
    image_wizardform_background := ImgLoad(WizardForm.Handle, ExpandConstant('{tmp}\background_welcome.png'), 0, 0, WIZARDFORM_WIDTH_NORMAL, WIZARDFORM_HEIGHT_NORMAL, FALSE, TRUE);
    button_license := BtnCreate(WizardForm.Handle, 110, 376, 96, 12, ExpandConstant('{tmp}\button_license.png'), 0, FALSE);
    BtnSetEvent(button_license, ID_BUTTON_ON_CLICK_EVENT, WrapBtnCallback(@button_license_on_click, 1));
    checkbox_license := BtnCreate(WizardForm.Handle, 11, 374, 93, 17, ExpandConstant('{tmp}\checkbox_license.png'), 0, TRUE);
    BtnSetEvent(checkbox_license, ID_BUTTON_ON_CLICK_EVENT, WrapBtnCallback(@checkbox_license_on_click, 1));
    BtnSetChecked(checkbox_license, TRUE);
    checkbox_setdefault := BtnCreate(WizardForm.Handle, 85, 470, 92, 17, ExpandConstant('{tmp}\checkbox_setdefault.png'), 0, TRUE);
    BtnSetEvent(checkbox_setdefault, ID_BUTTON_ON_CLICK_EVENT, WrapBtnCallback(@checkbox_setdefault_on_click, 1));
    BtnSetChecked(checkbox_setdefault, TRUE);
    BtnSetVisibility(checkbox_setdefault, FALSE);
    WizardForm.Height := WIZARDFORM_HEIGHT_NORMAL;
    ImgApplyChanges(WizardForm.Handle);
  END;
  IF (CurPageID = wpInstalling) THEN
  BEGIN
    edit_target_path.Hide;
    label_wizardform_more_product_already_installed.Hide;
    BtnSetVisibility(button_browse, FALSE);
    WizardForm.Height := WIZARDFORM_HEIGHT_NORMAL;
    is_wizardform_show_normal := TRUE;
    BtnSetVisibility(button_customize_setup, FALSE);
    BtnSetVisibility(button_uncustomize_setup, FALSE);
    BtnSetVisibility(checkbox_setdefault, FALSE);
    BtnSetVisibility(button_license, FALSE);
    BtnSetVisibility(checkbox_license, FALSE);
    image_wizardform_background := ImgLoad(WizardForm.Handle, ExpandConstant('{tmp}\background_installing.png'), 0, 0, WIZARDFORM_WIDTH_NORMAL, WIZARDFORM_HEIGHT_NORMAL, FALSE, TRUE);
    image_progressbar_background := ImgLoad(WizardForm.Handle, ExpandConstant('{tmp}\progressbar_background.png'), 20, 374, 560, 6, FALSE, TRUE);
    image_progressbar_foreground := ImgLoad(WizardForm.Handle, ExpandConstant('{tmp}\progressbar_foreground.png'), 20, 374, 0, 0, TRUE, TRUE);
    BtnSetVisibility(button_setup_or_next, FALSE);
    ImgApplyChanges(WizardForm.Handle);
  END;
  IF (CurPageID = wpFinished) THEN
  BEGIN
    ImgSetVisibility(image_progressbar_background, FALSE);
    ImgSetVisibility(image_progressbar_foreground, FALSE);
    button_setup_or_next := BtnCreate(WizardForm.Handle, 214, 305, 180, 44, ExpandConstant('{tmp}\button_finish.png'), 0, FALSE);
    BtnSetEvent(button_setup_or_next, ID_BUTTON_ON_CLICK_EVENT, WrapBtnCallback(@button_setup_or_next_on_click, 1));
    BtnSetEvent(button_close, ID_BUTTON_ON_CLICK_EVENT, WrapBtnCallback(@button_setup_or_next_on_click, 1));
    image_wizardform_background := ImgLoad(WizardForm.Handle, ExpandConstant('{tmp}\background_finish.png'), 0, 0, WIZARDFORM_WIDTH_NORMAL, WIZARDFORM_HEIGHT_NORMAL, FALSE, TRUE);
    ImgApplyChanges(WizardForm.Handle);
  END;
END;

PROCEDURE CurStepChanged(CurStep : TSetupStep);
BEGIN
  IF (CurStep = ssPostInstall) THEN
  BEGIN
    check_if_need_change_associations();
    //AND DO OTHER THINGS
  END;
  IF (CurStep = ssDone) THEN
  BEGIN
    is_wizardform_released := TRUE;
    ImgRelease(image_wizardform_background);
    ImgRelease(image_progressbar_background);
    ImgRelease(image_progressbar_foreground);
    ImgRelease(image_messagebox_background);
    gdipShutdown();
    messagebox_close.Release();
    WizardForm.Release();
  END;
END;

FUNCTION ShouldSkipPage(PageID : INTEGER) : BOOLEAN;
BEGIN
  IF (PageID = wpLicense) THEN Result := TRUE;
  IF (PageID = wpPassword) THEN Result := TRUE;
  IF (PageID = wpInfoBefore) THEN Result := TRUE;
  IF (PageID = wpUserInfo) THEN Result := TRUE;
  IF (PageID = wpSelectDir) THEN Result := TRUE;
  IF (PageID = wpSelectComponents) THEN Result := TRUE;
  IF (PageID = wpSelectProgramGroup) THEN Result := TRUE;
  IF (PageID = wpSelectTasks) THEN Result := TRUE;
  IF (PageID = wpReady) THEN Result := TRUE;
  IF (PageID = wpPreparing) THEN Result := TRUE;
  IF (PageID = wpInfoAfter) THEN Result := TRUE;
END;