added installer images.

added installer images.

Signed-off-by: DMZ Develoment <64b2b6d12bfe4baae7dad3d018f8cbf6b0e7a044@dmzdev.org>

#define BuildMode "opt"
#define AppName "cycles"
#define AppVerName "cycles 1.0"
#define Publisher "CHDS"
#define AppURL "http://dmzdev.org"
#define AppExeName "cycles.exe"
#define DependDir "..\..\..\depend"
#define VsDir "c:\Program Files\Microsoft Visual Studio 8"

[Setup]
AppId={{FF5299C5-982A-49CD-8A81-405BB6529401}
AppName={#AppName}
AppVerName={#AppVerName}
AppPublisher={#Publisher}
AppPublisherURL={#AppURL}
AppSupportURL={#AppURL}
AppUpdatesURL={#AppURL}
ShowLanguageDialog=no
DefaultDirName={pf}\{#AppName}
DefaultGroupName={#AppName}
UninstallDisplayName={#AppName}
UninstallDisplayIcon={app}\bin\{#AppExeName}
UninstallFilesDir={app}\uninst
OutputDir=.
OutputBaseFilename=cyclessetup
;OutputManifestFile=manifest.txt
WizardImageFile=WizImage.bmp
WizardSmallImageFile=WizSmallImage.bmp
SetupIconFile=Setup.ico
Compression=lzma
SolidCompression=yes

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

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

[Icons]
Name: {group}\{#AppName}; Filename: {app}\bin\{#AppExeName}; WorkingDir: {app}; IconFilename: {app}\bin\{#AppExeName}; Tasks:
Name: {group}\{cm:UninstallProgram,{#AppName}}; Filename: {uninstallexe}
Name: {userdesktop}\{#AppName}; Filename: {app}\bin\{#AppExeName}; Tasks: desktopicon; WorkingDir: {app}; IconFilename: {app}\bin\{#AppExeName}; Languages:
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#AppName}; Filename: {app}\bin\{#AppExeName}; Tasks: quicklaunchicon; WorkingDir: {app}; IconFilename: {app}\bin\{#AppExeName}; Languages:

[Run]
Filename: {app}\bin\{#AppExeName}; Description: {cm:LaunchProgram,{#AppName}}; Flags: nowait postinstall skipifsilent; Tasks: ; Languages:

[Registry]
Root: HKLM; Subkey: Software\DMZ\{#AppName}; ValueType: string; ValueName: workingDir; ValueData: {app}; Flags: uninsdeletekey
Root: HKCR; Subkey: cycles.file\shell\open\command; ValueType: string; ValueData: "{app}\bin\cycles.exe ""%1"""; Flags: uninsdeletekey

[Files]
Source: ..\..\..\bin\win32-{#BuildMode}\cycles.app\*; DestDir: {app}; Flags: recursesubdirs
Source: {#DependDir}\bin\QtCore4.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\QtGui4.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\QtOpenGL4.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\QtSvg4.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\QtXml4.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osg44-osg.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osg44-osgSim.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osg44-osgGA.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osg44-osgViewer.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osg44-osgUtil.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osg44-osgDB.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\ot11-OpenThreads.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\libpng13.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osgplugins-2.6.0\osgdb_png.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osgplugins-2.6.0\osgdb_obj.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\fmodex.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\fmodexL.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\fmodexp.dll; DestDir: {app}\bin
Source: {#VsDir}\VC\redist\x86\Microsoft.VC80.CRT\*; DestDir: {app}\bin\Microsoft.VC80.CRT

#define BuildMode "opt"
#define AppName "cycles"
#define AppVerName "cycles 1.0"
#define Publisher "CHDS"
#define AppURL "http://dmzdev.org"
#define AppExeName "cycles.exe"
#define DependDir "..\..\..\depend"
#define VsDir "c:\Program Files\Microsoft Visual Studio 8"

[Setup]
AppId={{FF5299C5-982A-49CD-8A81-405BB6529401}
AppName={#AppName}
AppVerName={#AppVerName}
AppPublisher={#Publisher}
AppPublisherURL={#AppURL}
AppSupportURL={#AppURL}
AppUpdatesURL={#AppURL}
ShowLanguageDialog=no
DefaultDirName={pf}\{#AppName}
DefaultGroupName={#AppName}
UninstallDisplayName={#AppName}
UninstallDisplayIcon={app}\bin\{#AppExeName}
UninstallFilesDir={app}\uninst
OutputDir=.
OutputBaseFilename=cyclessetup
;OutputManifestFile=manifest.txt
;WizardImageFile=WizImage.bmp
;WizardSmallImageFile=WizSmallImage.bmp
SetupIconFile=Setup.ico
Compression=lzma
SolidCompression=yes

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

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

[Icons]
Name: {group}\{#AppName}; Filename: {app}\bin\{#AppExeName}; WorkingDir: {app}; IconFilename: {app}\bin\{#AppExeName}; Tasks:
Name: {group}\{cm:UninstallProgram,{#AppName}}; Filename: {uninstallexe}
Name: {userdesktop}\{#AppName}; Filename: {app}\bin\{#AppExeName}; Tasks: desktopicon; WorkingDir: {app}; IconFilename: {app}\bin\{#AppExeName}; Languages:
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#AppName}; Filename: {app}\bin\{#AppExeName}; Tasks: quicklaunchicon; WorkingDir: {app}; IconFilename: {app}\bin\{#AppExeName}; Languages:

[Run]
Filename: {app}\bin\{#AppExeName}; Description: {cm:LaunchProgram,{#AppName}}; Flags: nowait postinstall skipifsilent; Tasks: ; Languages:

[Registry]
Root: HKLM; Subkey: Software\DMZ\{#AppName}; ValueType: string; ValueName: workingDir; ValueData: {app}; Flags: uninsdeletekey
Root: HKCR; Subkey: cycles.file\shell\open\command; ValueType: string; ValueData: "{app}\bin\cycles.exe ""%1"""; Flags: uninsdeletekey

[Files]
Source: ..\..\..\bin\win32-{#BuildMode}\cycles.app\*; DestDir: {app}; Flags: recursesubdirs
Source: {#DependDir}\bin\QtCore4.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\QtGui4.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\QtOpenGL4.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\QtSvg4.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\QtXml4.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osg44-osg.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osg44-osgSim.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osg44-osgGA.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osg44-osgViewer.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osg44-osgUtil.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osg44-osgDB.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\ot11-OpenThreads.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\libpng13.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osgplugins-2.6.0\osgdb_png.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osgplugins-2.6.0\osgdb_obj.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\fmodex.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\fmodexL.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\fmodexp.dll; DestDir: {app}\bin
Source: {#VsDir}\VC\redist\x86\Microsoft.VC80.CRT\*; DestDir: {app}\bin\Microsoft.VC80.CRT


[installer] launch on startup

[installer] launch on startup

; 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

; 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

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

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


ICL13 with VS2012 targets Vista by default

;* Notepad2-mod - Installer script
;*
;* Copyright (C) 2010-2013 XhmikosR
;*
;* This file is part of Notepad2-mod.
;*
;* See License.txt for details.

; Requirements:
; Inno Setup: http://www.jrsoftware.org/isdl.php

;#define ICL13
;#define VS2012
;#define WDK

; Preprocessor related stuff
#if VER < EncodeVer(5,5,2)
  #error Update your Inno Setup version (5.5.2 or newer)
#endif

#if !defined(ICL13) && !defined(VS2012) && !defined(WDK)
  #error You need to define the compiler used; ICL13, VS2012 or WDK
#endif

#if defined(ICL13) && (defined(VS2012) || defined(WDK)) || defined(VS2012) && defined(WDK)
  #error You can't use two or more compiler defines at the same time
#endif

#if defined(ICL13)
  #define compiler "ICL13"
  #define sse2_required
#elif defined(VS2012)
  #define compiler "VS2012"
#elif defined(WDK)
  #define compiler "WDK"
#endif

#define bindir "..\bin\" + compiler

#ifnexist bindir + "\Release_x86\Notepad2.exe"
  #error Compile Notepad2 x86 first
#endif

#ifnexist bindir + "\Release_x64\Notepad2.exe"
  #error Compile Notepad2 x64 first
#endif

#define VerMajor
#define VerMinor
#define VerBuild
#define VerRevision

#expr ParseVersion(bindir + "\Release_x86\Notepad2.exe", VerMajor, VerMinor, VerBuild, VerRevision)
#define app_version   str(VerMajor) + "." + str(VerMinor) + "." + str(VerBuild) + "." + str(VerRevision)
#define app_name      "Notepad2-mod"
#define app_copyright "Copyright  2004-2013, Florian Balmer et al."
#define quick_launch  "{userappdata}\Microsoft\Internet Explorer\Quick Launch"

[Setup]
AppId={#app_name}
AppName={#app_name}
AppVersion={#app_version}
AppVerName={#app_name} {#app_version}
AppPublisher=XhmikosR
AppPublisherURL=https://github.com/XhmikosR/notepad2-mod
AppSupportURL=https://github.com/XhmikosR/notepad2-mod
AppUpdatesURL=https://github.com/XhmikosR/notepad2-mod
AppContact=https://github.com/XhmikosR/notepad2-mod
AppCopyright={#app_copyright}
VersionInfoCompany=XhmikosR
VersionInfoCopyright={#app_copyright}
VersionInfoDescription={#app_name} {#app_version} Setup
VersionInfoTextVersion={#app_version}
VersionInfoVersion={#app_version}
VersionInfoProductName={#app_name}
VersionInfoProductVersion={#app_version}
VersionInfoProductTextVersion={#app_version}
UninstallDisplayIcon={app}\Notepad2.exe
UninstallDisplayName={#app_name} {#app_version} ({#compiler})
DefaultDirName={pf}\Notepad2
LicenseFile=license.txt
OutputDir=.
#if defined(WDK)
OutputBaseFilename={#app_name}.{#app_version}
#else
OutputBaseFilename={#app_name}.{#app_version}_{#compiler}
#endif
SetupIconFile=Setup.ico
WizardImageFile=compiler:WizModernImage-IS.bmp
WizardSmallImageFile=WizardSmallImageFile.bmp
Compression=lzma2/max
InternalCompressLevel=max
SolidCompression=yes
EnableDirDoesntExistWarning=no
AllowNoIcons=yes
ShowTasksTreeLines=yes
DisableDirPage=yes
DisableProgramGroupPage=yes
DisableReadyPage=yes
DisableWelcomePage=yes
AllowCancelDuringInstall=no
#if defined(ICL13)
MinVersion=6.0
#elif defined(WDK)
MinVersion=5.0
#else
MinVersion=5.1.2600sp3
#endif
ArchitecturesAllowed=x86 x64
ArchitecturesInstallIn64BitMode=x64

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

[Messages]
BeveledLabel     ={#app_name} {#app_version}  -  Compiled with {#compiler}
SetupAppTitle    =Setup - {#app_name}
SetupWindowTitle =Setup - {#app_name}

[CustomMessages]
en.msg_AppIsRunning          =Setup has detected that {#app_name} is currently running.%n%nPlease close all instances of it now, then click OK to continue, or Cancel to exit.
en.msg_AppIsRunningUninstall =Uninstall has detected that {#app_name} is currently running.%n%nPlease close all instances of it now, then click OK to continue, or Cancel to exit.
en.msg_DeleteSettings        =Do you also want to delete {#app_name}'s settings?%n%nIf you plan on installing {#app_name} again then you do not have to delete them.
en.msg_SetupIsRunningWarning ={#app_name} setup is already running!
#if defined(sse_required)
en.msg_simd_sse              =This build of {#app_name} requires a CPU with SSE extension support.%n%nYour CPU does not have those capabilities.
#elif defined(sse2_required)
en.msg_simd_sse2             =This build of {#app_name} requires a CPU with SSE2 extension support.%n%nYour CPU does not have those capabilities.
#endif
en.tsk_AllUsers              =For all users
en.tsk_CurrentUser           =For the current user only
en.tsk_Other                 =Other tasks:
en.tsk_ResetSettings         =Reset {#app_name}'s settings
en.tsk_RemoveDefault         =Restore Windows notepad
en.tsk_SetDefault            =Replace Windows notepad with {#app_name}

[Tasks]
Name: desktopicon;        Description: {cm:CreateDesktopIcon};     GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
Name: desktopicon\user;   Description: {cm:tsk_CurrentUser};       GroupDescription: {cm:AdditionalIcons}; Flags: unchecked exclusive
Name: desktopicon\common; Description: {cm:tsk_AllUsers};          GroupDescription: {cm:AdditionalIcons}; Flags: unchecked exclusive
Name: quicklaunchicon;    Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked;             OnlyBelowVersion: 6.01
Name: reset_settings;     Description: {cm:tsk_ResetSettings};     GroupDescription: {cm:tsk_Other};       Flags: checkedonce unchecked; Check: SettingsExistCheck()
Name: set_default;        Description: {cm:tsk_SetDefault};        GroupDescription: {cm:tsk_Other};                                     Check: not DefaulNotepadCheck()
Name: remove_default;     Description: {cm:tsk_RemoveDefault};     GroupDescription: {cm:tsk_Other};       Flags: checkedonce unchecked; Check: DefaulNotepadCheck()

[Files]
Source: psvince.dll;                        DestDir: {app};                  Flags: ignoreversion
Source: ..\License.txt;                     DestDir: {app};                  Flags: ignoreversion
Source: {#bindir}\Release_x64\Notepad2.exe; DestDir: {app};                  Flags: ignoreversion;                         Check: Is64BitInstallMode()
Source: {#bindir}\Release_x86\Notepad2.exe; DestDir: {app};                  Flags: ignoreversion;                         Check: not Is64BitInstallMode()
Source: Notepad2.ini;                       DestDir: {userappdata}\Notepad2; Flags: onlyifdoesntexist uninsneveruninstall
Source: ..\Notepad2.txt;                    DestDir: {app};                  Flags: ignoreversion
Source: ..\Readme-mod.txt;                  DestDir: {app};                  Flags: ignoreversion

[Icons]
Name: {commondesktop}\{#app_name}; Filename: {app}\Notepad2.exe; Tasks: desktopicon\common; Comment: {#app_name} {#app_version}; WorkingDir: {app}; AppUserModelID: Notepad2; IconFilename: {app}\Notepad2.exe; IconIndex: 0
Name: {userdesktop}\{#app_name};   Filename: {app}\Notepad2.exe; Tasks: desktopicon\user;   Comment: {#app_name} {#app_version}; WorkingDir: {app}; AppUserModelID: Notepad2; IconFilename: {app}\Notepad2.exe; IconIndex: 0
Name: {#quick_launch}\{#app_name}; Filename: {app}\Notepad2.exe; Tasks: quicklaunchicon;    Comment: {#app_name} {#app_version}; WorkingDir: {app};                           IconFilename: {app}\Notepad2.exe; IconIndex: 0

[INI]
Filename: {app}\Notepad2.ini; Section: Notepad2; Key: Notepad2.ini; String: %APPDATA%\Notepad2\Notepad2.ini

[Run]
Filename: {app}\Notepad2.exe; Description: {cm:LaunchProgram,{#app_name}}; WorkingDir: {app}; Flags: nowait postinstall skipifsilent unchecked

[InstallDelete]
Type: files;      Name: {userdesktop}\{#app_name}.lnk;   Check: not IsTaskSelected('desktopicon\user')   and IsUpgrade()
Type: files;      Name: {commondesktop}\{#app_name}.lnk; Check: not IsTaskSelected('desktopicon\common') and IsUpgrade()
Type: files;      Name: {#quick_launch}\{#app_name}.lnk; Check: not IsTaskSelected('quicklaunchicon')    and IsUpgrade(); OnlyBelowVersion: 6.01
Type: files;      Name: {app}\Notepad2.ini
Type: files;      Name: {app}\Readme.txt

[UninstallDelete]
Type: files;      Name: {app}\Notepad2.ini
Type: dirifempty; Name: {app}

[Code]
const
  installer_mutex = '{#app_name}' + '_setup_mutex';
  IFEO            = 'SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe';

function IsModuleLoaded(modulename: AnsiString): Boolean;
external 'IsModuleLoaded2@files:psvince.dll stdcall setuponly';

function IsModuleLoadedU(modulename: AnsiString): Boolean;
external 'IsModuleLoaded2@{app}\psvince.dll stdcall uninstallonly';

#if defined(sse_required) || defined(sse2_required)
function IsProcessorFeaturePresent(Feature: Integer): Boolean;
external 'IsProcessorFeaturePresent@kernel32.dll stdcall';
#endif

// Check if Notepad2 has replaced Windows Notepad
function DefaulNotepadCheck(): Boolean;
var
  sDebugger: String;
begin
  if RegQueryStringValue(HKLM, IFEO, 'Debugger', sDebugger) and
  (sDebugger = (ExpandConstant('"{app}\Notepad2.exe" /z'))) then begin
    Log('Custom Code: {#app_name} is set as the default notepad');
    Result := True;
  end
  else begin
    Log('Custom Code: {#app_name} is NOT set as the default notepad');
    Result := False;
  end;
end;

#if defined(sse_required)
function IsSSESupported(): Boolean;
begin
  // PF_XMMI_INSTRUCTIONS_AVAILABLE
  Result := IsProcessorFeaturePresent(6);
end;

#elif defined(sse2_required)

function IsSSE2Supported(): Boolean;
begin
  // PF_XMMI64_INSTRUCTIONS_AVAILABLE
  Result := IsProcessorFeaturePresent(10);
end;

#endif

function IsOldBuildInstalled(sInfFile: String): Boolean;
begin
  if RegKeyExists(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Notepad2') and
  FileExists(ExpandConstant('{pf}\Notepad2\' + sInfFile)) then
    Result := True
  else
    Result := False;
end;

function IsUpgrade(): Boolean;
var
  sPrevPath: String;
begin
  sPrevPath := WizardForm.PrevAppDir;
  Result := (sPrevPath <> '');
end;

// Check if Notepad2's settings exist
function SettingsExistCheck(): Boolean;
begin
  if FileExists(ExpandConstant('{userappdata}\Notepad2\Notepad2.ini')) then begin
    Log('Custom Code: Settings are present');
    Result := True;
  end
  else begin
    Log('Custom Code: Settings are NOT present');
    Result := False;
  end;
end;

function UninstallOldVersion(sInfFile: String): Integer;
var
  iResultCode: Integer;
begin
  // Return Values:
  // 0 - no idea
  // 1 - error executing the command
  // 2 - successfully executed the command

  // default return value
  Result := 0;
  // TODO: use RegQueryStringValue
  if not Exec('rundll32.exe', ExpandConstant('advpack.dll,LaunchINFSectionEx ' + '"{pf}\Notepad2\' + sInfFile +'",DefaultUninstall,,8,N'), '', SW_HIDE, ewWaitUntilTerminated, iResultCode) then begin
    Result := 1;
  end
  else begin
    Result := 2;
    Sleep(200);
  end;
end;

function ShouldSkipPage(PageID: Integer): Boolean;
begin
  // Hide the license page if IsUpgrade()
  if IsUpgrade() and (PageID = wpLicense) then
    Result := True;
end;

procedure AddReg();
begin
  RegWriteStringValue(HKCR, 'Applications\notepad2.exe', 'AppUserModelID', 'Notepad2');
  RegWriteStringValue(HKCR, 'Applications\notepad2.exe\shell\open\command', '', ExpandConstant('"{app}\Notepad2.exe" %1'));
  RegWriteStringValue(HKCR, '*\OpenWithList\notepad2.exe', '', '');
end;

procedure CleanUpSettings();
begin
  DeleteFile(ExpandConstant('{userappdata}\Notepad2\Notepad2.ini'));
  RemoveDir(ExpandConstant('{userappdata}\Notepad2'));
end;

procedure RemoveReg();
begin
  RegDeleteKeyIncludingSubkeys(HKCR, 'Applications\notepad2.exe');
  RegDeleteKeyIncludingSubkeys(HKCR, '*\OpenWithList\notepad2.exe');
end;

procedure CurPageChanged(CurPageID: Integer);
begin
  if CurPageID = wpSelectTasks then
    WizardForm.NextButton.Caption := SetupMessage(msgButtonInstall)
  else if CurPageID = wpFinished then
    WizardForm.NextButton.Caption := SetupMessage(msgButtonFinish);
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
  if CurStep = ssInstall then begin
    if IsTaskSelected('reset_settings') then
      CleanUpSettings();

    if IsOldBuildInstalled('Uninstall.inf') or IsOldBuildInstalled('Notepad2.inf') then begin
      if IsOldBuildInstalled('Uninstall.inf') then begin
        Log('Custom Code: The old build is installed, will try to uninstall it');
        if UninstallOldVersion('Uninstall.inf') = 2 then
          Log('Custom Code: The old build was successfully uninstalled')
        else
          Log('Custom Code: Something went wrong when uninstalling the old build');
      end;

      if IsOldBuildInstalled('Notepad2.inf') then begin
        Log('Custom Code: The official Notepad2 build is installed, will try to uninstall it');
        if UninstallOldVersion('Notepad2.inf') = 2 then
          Log('Custom Code: The official Notepad2 build was successfully uninstalled')
        else
          Log('Custom Code: Something went wrong when uninstalling the official Notepad2 build');
      end;

      // This is the case where the old build is installed; the DefaulNotepadCheck() returns true
      // and the set_default task isn't selected
      if not IsTaskSelected('remove_default') then
        RegWriteStringValue(HKLM, IFEO, 'Debugger', ExpandConstant('"{app}\Notepad2.exe" /z'));

    end;
  end;

  if CurStep = ssPostInstall then begin
    if IsTaskSelected('set_default') then
      RegWriteStringValue(HKLM, IFEO, 'Debugger', ExpandConstant('"{app}\Notepad2.exe" /z'));
    if IsTaskSelected('remove_default') then begin
      RegDeleteValue(HKLM, IFEO, 'Debugger');
      RegDeleteKeyIfEmpty(HKLM, IFEO);
    end;
    // Always add Notepad2's AppUserModelID and the rest registry values
    AddReg();
  end;

end;

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  // When uninstalling, ask the user to delete Notepad2's settings
  if CurUninstallStep = usUninstall then begin
    if SettingsExistCheck() then begin
      if SuppressibleMsgBox(CustomMessage('msg_DeleteSettings'), mbConfirmation, MB_YESNO or MB_DEFBUTTON2, IDNO) = IDYES then
        CleanUpSettings();
    end;

    if DefaulNotepadCheck() then
      RegDeleteValue(HKLM, IFEO, 'Debugger');
    RegDeleteKeyIfEmpty(HKLM, IFEO);
    RemoveReg();

  end;
end;

procedure InitializeWizard();
begin
  WizardForm.SelectTasksLabel.Hide;
  WizardForm.TasksList.Top    := 0;
  WizardForm.TasksList.Height := PageFromID(wpSelectTasks).SurfaceHeight;
end;

function InitializeSetup(): Boolean;
var
  iMsgBoxResult: Integer;
begin
  // Create a mutex for the installer and if it's already running then show a message and stop installation
  if CheckForMutexes(installer_mutex) and not WizardSilent() then begin
    SuppressibleMsgBox(CustomMessage('msg_SetupIsRunningWarning'), mbError, MB_OK, MB_OK);
    Result := False;
  end
  else begin
    Result := True;
    CreateMutex(installer_mutex);

    while IsModuleLoaded('Notepad2.exe') and (iMsgBoxResult <> IDCANCEL) do
      iMsgBoxResult := SuppressibleMsgBox(CustomMessage('msg_AppIsRunning'), mbError, MB_OKCANCEL, IDCANCEL);

    if iMsgBoxResult = IDCANCEL then
      Result := False;

#if defined(sse2_required)
    if not IsSSE2Supported() then begin
      SuppressibleMsgBox(CustomMessage('msg_simd_sse2'), mbCriticalError, MB_OK, MB_OK);
      Result := False;
    end;
#elif defined(sse_required)
    if not IsSSESupported() then begin
      SuppressibleMsgBox(CustomMessage('msg_simd_sse'), mbCriticalError, MB_OK, MB_OK);
      Result := False;
    end;
#endif

  end;
end;

function InitializeUninstall(): Boolean;
var
  iMsgBoxResult: Integer;
begin
  if CheckForMutexes(installer_mutex) then begin
    SuppressibleMsgBox(CustomMessage('msg_SetupIsRunningWarning'), mbError, MB_OK, MB_OK);
    Result := False;
  end
  else begin
    Result := True;
    CreateMutex(installer_mutex);

    // Check if Notepad2 is running during uninstallation
    while IsModuleLoadedU('Notepad2.exe') and (iMsgBoxResult <> IDCANCEL) do
      iMsgBoxResult := SuppressibleMsgBox(CustomMessage('msg_AppIsRunningUninstall'), mbError, MB_OKCANCEL, IDCANCEL);

    if iMsgBoxResult = IDCANCEL then
      Result := False;

    // Unload psvince.dll in order to be uninstalled
    UnloadDLL(ExpandConstant('{app}\psvince.dll'));
  end;
end;

;* Notepad2-mod - Installer script
;*
;* Copyright (C) 2010-2013 XhmikosR
;*
;* This file is part of Notepad2-mod.
;*
;* See License.txt for details.

; Requirements:
; Inno Setup: http://www.jrsoftware.org/isdl.php

;#define ICL13
;#define VS2012
;#define WDK

; Preprocessor related stuff
#if VER < EncodeVer(5,5,2)
  #error Update your Inno Setup version (5.5.2 or newer)
#endif

#if !defined(ICL13) && !defined(VS2012) && !defined(WDK)
  #error You need to define the compiler used; ICL13, VS2012 or WDK
#endif

#if defined(ICL13) && (defined(VS2012) || defined(WDK)) || defined(VS2012) && defined(WDK)
  #error You can't use two or more compiler defines at the same time
#endif

#if defined(ICL13)
  #define compiler "ICL13"
  #define sse2_required
#elif defined(VS2012)
  #define compiler "VS2012"
#elif defined(WDK)
  #define compiler "WDK"
#endif

#define bindir "..\bin\" + compiler

#ifnexist bindir + "\Release_x86\Notepad2.exe"
  #error Compile Notepad2 x86 first
#endif

#ifnexist bindir + "\Release_x64\Notepad2.exe"
  #error Compile Notepad2 x64 first
#endif

#define VerMajor
#define VerMinor
#define VerBuild
#define VerRevision

#expr ParseVersion(bindir + "\Release_x86\Notepad2.exe", VerMajor, VerMinor, VerBuild, VerRevision)
#define app_version   str(VerMajor) + "." + str(VerMinor) + "." + str(VerBuild) + "." + str(VerRevision)
#define app_name      "Notepad2-mod"
#define app_copyright "Copyright  2004-2013, Florian Balmer et al."
#define quick_launch  "{userappdata}\Microsoft\Internet Explorer\Quick Launch"

[Setup]
AppId={#app_name}
AppName={#app_name}
AppVersion={#app_version}
AppVerName={#app_name} {#app_version}
AppPublisher=XhmikosR
AppPublisherURL=https://github.com/XhmikosR/notepad2-mod
AppSupportURL=https://github.com/XhmikosR/notepad2-mod
AppUpdatesURL=https://github.com/XhmikosR/notepad2-mod
AppContact=https://github.com/XhmikosR/notepad2-mod
AppCopyright={#app_copyright}
VersionInfoCompany=XhmikosR
VersionInfoCopyright={#app_copyright}
VersionInfoDescription={#app_name} {#app_version} Setup
VersionInfoTextVersion={#app_version}
VersionInfoVersion={#app_version}
VersionInfoProductName={#app_name}
VersionInfoProductVersion={#app_version}
VersionInfoProductTextVersion={#app_version}
UninstallDisplayIcon={app}\Notepad2.exe
UninstallDisplayName={#app_name} {#app_version} ({#compiler})
DefaultDirName={pf}\Notepad2
LicenseFile=license.txt
OutputDir=.
#if defined(WDK)
OutputBaseFilename={#app_name}.{#app_version}
#else
OutputBaseFilename={#app_name}.{#app_version}_{#compiler}
#endif
SetupIconFile=Setup.ico
WizardImageFile=compiler:WizModernImage-IS.bmp
WizardSmallImageFile=WizardSmallImageFile.bmp
Compression=lzma2/max
InternalCompressLevel=max
SolidCompression=yes
EnableDirDoesntExistWarning=no
AllowNoIcons=yes
ShowTasksTreeLines=yes
DisableDirPage=yes
DisableProgramGroupPage=yes
DisableReadyPage=yes
DisableWelcomePage=yes
AllowCancelDuringInstall=no
#if defined(WDK)
MinVersion=5.0
#else
MinVersion=5.1.2600sp3
#endif
ArchitecturesAllowed=x86 x64
ArchitecturesInstallIn64BitMode=x64

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

[Messages]
BeveledLabel     ={#app_name} {#app_version}  -  Compiled with {#compiler}
SetupAppTitle    =Setup - {#app_name}
SetupWindowTitle =Setup - {#app_name}

[CustomMessages]
en.msg_AppIsRunning          =Setup has detected that {#app_name} is currently running.%n%nPlease close all instances of it now, then click OK to continue, or Cancel to exit.
en.msg_AppIsRunningUninstall =Uninstall has detected that {#app_name} is currently running.%n%nPlease close all instances of it now, then click OK to continue, or Cancel to exit.
en.msg_DeleteSettings        =Do you also want to delete {#app_name}'s settings?%n%nIf you plan on installing {#app_name} again then you do not have to delete them.
en.msg_SetupIsRunningWarning ={#app_name} setup is already running!
#if defined(sse_required)
en.msg_simd_sse              =This build of {#app_name} requires a CPU with SSE extension support.%n%nYour CPU does not have those capabilities.
#elif defined(sse2_required)
en.msg_simd_sse2             =This build of {#app_name} requires a CPU with SSE2 extension support.%n%nYour CPU does not have those capabilities.
#endif
en.tsk_AllUsers              =For all users
en.tsk_CurrentUser           =For the current user only
en.tsk_Other                 =Other tasks:
en.tsk_ResetSettings         =Reset {#app_name}'s settings
en.tsk_RemoveDefault         =Restore Windows notepad
en.tsk_SetDefault            =Replace Windows notepad with {#app_name}

[Tasks]
Name: desktopicon;        Description: {cm:CreateDesktopIcon};     GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
Name: desktopicon\user;   Description: {cm:tsk_CurrentUser};       GroupDescription: {cm:AdditionalIcons}; Flags: unchecked exclusive
Name: desktopicon\common; Description: {cm:tsk_AllUsers};          GroupDescription: {cm:AdditionalIcons}; Flags: unchecked exclusive
Name: quicklaunchicon;    Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked;             OnlyBelowVersion: 6.01
Name: reset_settings;     Description: {cm:tsk_ResetSettings};     GroupDescription: {cm:tsk_Other};       Flags: checkedonce unchecked; Check: SettingsExistCheck()
Name: set_default;        Description: {cm:tsk_SetDefault};        GroupDescription: {cm:tsk_Other};                                     Check: not DefaulNotepadCheck()
Name: remove_default;     Description: {cm:tsk_RemoveDefault};     GroupDescription: {cm:tsk_Other};       Flags: checkedonce unchecked; Check: DefaulNotepadCheck()

[Files]
Source: psvince.dll;                        DestDir: {app};                  Flags: ignoreversion
Source: ..\License.txt;                     DestDir: {app};                  Flags: ignoreversion
Source: {#bindir}\Release_x64\Notepad2.exe; DestDir: {app};                  Flags: ignoreversion;                         Check: Is64BitInstallMode()
Source: {#bindir}\Release_x86\Notepad2.exe; DestDir: {app};                  Flags: ignoreversion;                         Check: not Is64BitInstallMode()
Source: Notepad2.ini;                       DestDir: {userappdata}\Notepad2; Flags: onlyifdoesntexist uninsneveruninstall
Source: ..\Notepad2.txt;                    DestDir: {app};                  Flags: ignoreversion
Source: ..\Readme-mod.txt;                  DestDir: {app};                  Flags: ignoreversion

[Icons]
Name: {commondesktop}\{#app_name}; Filename: {app}\Notepad2.exe; Tasks: desktopicon\common; Comment: {#app_name} {#app_version}; WorkingDir: {app}; AppUserModelID: Notepad2; IconFilename: {app}\Notepad2.exe; IconIndex: 0
Name: {userdesktop}\{#app_name};   Filename: {app}\Notepad2.exe; Tasks: desktopicon\user;   Comment: {#app_name} {#app_version}; WorkingDir: {app}; AppUserModelID: Notepad2; IconFilename: {app}\Notepad2.exe; IconIndex: 0
Name: {#quick_launch}\{#app_name}; Filename: {app}\Notepad2.exe; Tasks: quicklaunchicon;    Comment: {#app_name} {#app_version}; WorkingDir: {app};                           IconFilename: {app}\Notepad2.exe; IconIndex: 0

[INI]
Filename: {app}\Notepad2.ini; Section: Notepad2; Key: Notepad2.ini; String: %APPDATA%\Notepad2\Notepad2.ini

[Run]
Filename: {app}\Notepad2.exe; Description: {cm:LaunchProgram,{#app_name}}; WorkingDir: {app}; Flags: nowait postinstall skipifsilent unchecked

[InstallDelete]
Type: files;      Name: {userdesktop}\{#app_name}.lnk;   Check: not IsTaskSelected('desktopicon\user')   and IsUpgrade()
Type: files;      Name: {commondesktop}\{#app_name}.lnk; Check: not IsTaskSelected('desktopicon\common') and IsUpgrade()
Type: files;      Name: {#quick_launch}\{#app_name}.lnk; Check: not IsTaskSelected('quicklaunchicon')    and IsUpgrade(); OnlyBelowVersion: 6.01
Type: files;      Name: {app}\Notepad2.ini
Type: files;      Name: {app}\Readme.txt

[UninstallDelete]
Type: files;      Name: {app}\Notepad2.ini
Type: dirifempty; Name: {app}

[Code]
const
  installer_mutex = '{#app_name}' + '_setup_mutex';
  IFEO            = 'SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe';

function IsModuleLoaded(modulename: AnsiString): Boolean;
external 'IsModuleLoaded2@files:psvince.dll stdcall setuponly';

function IsModuleLoadedU(modulename: AnsiString): Boolean;
external 'IsModuleLoaded2@{app}\psvince.dll stdcall uninstallonly';

#if defined(sse_required) || defined(sse2_required)
function IsProcessorFeaturePresent(Feature: Integer): Boolean;
external 'IsProcessorFeaturePresent@kernel32.dll stdcall';
#endif

// Check if Notepad2 has replaced Windows Notepad
function DefaulNotepadCheck(): Boolean;
var
  sDebugger: String;
begin
  if RegQueryStringValue(HKLM, IFEO, 'Debugger', sDebugger) and
  (sDebugger = (ExpandConstant('"{app}\Notepad2.exe" /z'))) then begin
    Log('Custom Code: {#app_name} is set as the default notepad');
    Result := True;
  end
  else begin
    Log('Custom Code: {#app_name} is NOT set as the default notepad');
    Result := False;
  end;
end;

#if defined(sse_required)
function IsSSESupported(): Boolean;
begin
  // PF_XMMI_INSTRUCTIONS_AVAILABLE
  Result := IsProcessorFeaturePresent(6);
end;

#elif defined(sse2_required)

function IsSSE2Supported(): Boolean;
begin
  // PF_XMMI64_INSTRUCTIONS_AVAILABLE
  Result := IsProcessorFeaturePresent(10);
end;

#endif

function IsOldBuildInstalled(sInfFile: String): Boolean;
begin
  if RegKeyExists(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Notepad2') and
  FileExists(ExpandConstant('{pf}\Notepad2\' + sInfFile)) then
    Result := True
  else
    Result := False;
end;

function IsUpgrade(): Boolean;
var
  sPrevPath: String;
begin
  sPrevPath := WizardForm.PrevAppDir;
  Result := (sPrevPath <> '');
end;

// Check if Notepad2's settings exist
function SettingsExistCheck(): Boolean;
begin
  if FileExists(ExpandConstant('{userappdata}\Notepad2\Notepad2.ini')) then begin
    Log('Custom Code: Settings are present');
    Result := True;
  end
  else begin
    Log('Custom Code: Settings are NOT present');
    Result := False;
  end;
end;

function UninstallOldVersion(sInfFile: String): Integer;
var
  iResultCode: Integer;
begin
  // Return Values:
  // 0 - no idea
  // 1 - error executing the command
  // 2 - successfully executed the command

  // default return value
  Result := 0;
  // TODO: use RegQueryStringValue
  if not Exec('rundll32.exe', ExpandConstant('advpack.dll,LaunchINFSectionEx ' + '"{pf}\Notepad2\' + sInfFile +'",DefaultUninstall,,8,N'), '', SW_HIDE, ewWaitUntilTerminated, iResultCode) then begin
    Result := 1;
  end
  else begin
    Result := 2;
    Sleep(200);
  end;
end;

function ShouldSkipPage(PageID: Integer): Boolean;
begin
  // Hide the license page if IsUpgrade()
  if IsUpgrade() and (PageID = wpLicense) then
    Result := True;
end;

procedure AddReg();
begin
  RegWriteStringValue(HKCR, 'Applications\notepad2.exe', 'AppUserModelID', 'Notepad2');
  RegWriteStringValue(HKCR, 'Applications\notepad2.exe\shell\open\command', '', ExpandConstant('"{app}\Notepad2.exe" %1'));
  RegWriteStringValue(HKCR, '*\OpenWithList\notepad2.exe', '', '');
end;

procedure CleanUpSettings();
begin
  DeleteFile(ExpandConstant('{userappdata}\Notepad2\Notepad2.ini'));
  RemoveDir(ExpandConstant('{userappdata}\Notepad2'));
end;

procedure RemoveReg();
begin
  RegDeleteKeyIncludingSubkeys(HKCR, 'Applications\notepad2.exe');
  RegDeleteKeyIncludingSubkeys(HKCR, '*\OpenWithList\notepad2.exe');
end;

procedure CurPageChanged(CurPageID: Integer);
begin
  if CurPageID = wpSelectTasks then
    WizardForm.NextButton.Caption := SetupMessage(msgButtonInstall)
  else if CurPageID = wpFinished then
    WizardForm.NextButton.Caption := SetupMessage(msgButtonFinish);
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
  if CurStep = ssInstall then begin
    if IsTaskSelected('reset_settings') then
      CleanUpSettings();

    if IsOldBuildInstalled('Uninstall.inf') or IsOldBuildInstalled('Notepad2.inf') then begin
      if IsOldBuildInstalled('Uninstall.inf') then begin
        Log('Custom Code: The old build is installed, will try to uninstall it');
        if UninstallOldVersion('Uninstall.inf') = 2 then
          Log('Custom Code: The old build was successfully uninstalled')
        else
          Log('Custom Code: Something went wrong when uninstalling the old build');
      end;

      if IsOldBuildInstalled('Notepad2.inf') then begin
        Log('Custom Code: The official Notepad2 build is installed, will try to uninstall it');
        if UninstallOldVersion('Notepad2.inf') = 2 then
          Log('Custom Code: The official Notepad2 build was successfully uninstalled')
        else
          Log('Custom Code: Something went wrong when uninstalling the official Notepad2 build');
      end;

      // This is the case where the old build is installed; the DefaulNotepadCheck() returns true
      // and the set_default task isn't selected
      if not IsTaskSelected('remove_default') then
        RegWriteStringValue(HKLM, IFEO, 'Debugger', ExpandConstant('"{app}\Notepad2.exe" /z'));

    end;
  end;

  if CurStep = ssPostInstall then begin
    if IsTaskSelected('set_default') then
      RegWriteStringValue(HKLM, IFEO, 'Debugger', ExpandConstant('"{app}\Notepad2.exe" /z'));
    if IsTaskSelected('remove_default') then begin
      RegDeleteValue(HKLM, IFEO, 'Debugger');
      RegDeleteKeyIfEmpty(HKLM, IFEO);
    end;
    // Always add Notepad2's AppUserModelID and the rest registry values
    AddReg();
  end;

end;

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  // When uninstalling, ask the user to delete Notepad2's settings
  if CurUninstallStep = usUninstall then begin
    if SettingsExistCheck() then begin
      if SuppressibleMsgBox(CustomMessage('msg_DeleteSettings'), mbConfirmation, MB_YESNO or MB_DEFBUTTON2, IDNO) = IDYES then
        CleanUpSettings();
    end;

    if DefaulNotepadCheck() then
      RegDeleteValue(HKLM, IFEO, 'Debugger');
    RegDeleteKeyIfEmpty(HKLM, IFEO);
    RemoveReg();

  end;
end;

procedure InitializeWizard();
begin
  WizardForm.SelectTasksLabel.Hide;
  WizardForm.TasksList.Top    := 0;
  WizardForm.TasksList.Height := PageFromID(wpSelectTasks).SurfaceHeight;
end;

function InitializeSetup(): Boolean;
var
  iMsgBoxResult: Integer;
begin
  // Create a mutex for the installer and if it's already running then show a message and stop installation
  if CheckForMutexes(installer_mutex) and not WizardSilent() then begin
    SuppressibleMsgBox(CustomMessage('msg_SetupIsRunningWarning'), mbError, MB_OK, MB_OK);
    Result := False;
  end
  else begin
    Result := True;
    CreateMutex(installer_mutex);

    while IsModuleLoaded('Notepad2.exe') and (iMsgBoxResult <> IDCANCEL) do
      iMsgBoxResult := SuppressibleMsgBox(CustomMessage('msg_AppIsRunning'), mbError, MB_OKCANCEL, IDCANCEL);

    if iMsgBoxResult = IDCANCEL then
      Result := False;

#if defined(sse2_required)
    if not IsSSE2Supported() then begin
      SuppressibleMsgBox(CustomMessage('msg_simd_sse2'), mbCriticalError, MB_OK, MB_OK);
      Result := False;
    end;
#elif defined(sse_required)
    if not IsSSESupported() then begin
      SuppressibleMsgBox(CustomMessage('msg_simd_sse'), mbCriticalError, MB_OK, MB_OK);
      Result := False;
    end;
#endif

  end;
end;

function InitializeUninstall(): Boolean;
var
  iMsgBoxResult: Integer;
begin
  if CheckForMutexes(installer_mutex) then begin
    SuppressibleMsgBox(CustomMessage('msg_SetupIsRunningWarning'), mbError, MB_OK, MB_OK);
    Result := False;
  end
  else begin
    Result := True;
    CreateMutex(installer_mutex);

    // Check if Notepad2 is running during uninstallation
    while IsModuleLoadedU('Notepad2.exe') and (iMsgBoxResult <> IDCANCEL) do
      iMsgBoxResult := SuppressibleMsgBox(CustomMessage('msg_AppIsRunningUninstall'), mbError, MB_OKCANCEL, IDCANCEL);

    if iMsgBoxResult = IDCANCEL then
      Result := False;

    // Unload psvince.dll in order to be uninstalled
    UnloadDLL(ExpandConstant('{app}\psvince.dll'));
  end;
end;


Better installer/uninstaller

Better installer/uninstaller

Fixed vc redist checks and added prompt to kill running instances of aurora before install and uninstall.

#define public Version "0.6.1"

#ifdef EXTERNAL_VERSION
 #if len(EXTERNAL_VERSION)>0
     #define public Version EXTERNAL_VERSION
 #endif
#endif

[Setup]
AppId={{9444602B-C5D8-4EF5-9D5B-E76D06B53C71}
AppName=Aurora
AppVersion=v{#Version}
AppVerName=Aurora v{#Version}
AppPublisher=Anton Pupkov
AppPublisherURL=http://www.project-aurora.com/
AppSupportURL=https://github.com/antonpup/Aurora/issues/
AppUpdatesURL=https://github.com/antonpup/Aurora/releases
DefaultDirName={pf64}\Aurora
DisableProgramGroupPage=yes
DisableWelcomePage=no
OutputDir=..\
OutputBaseFilename=Aurora-setup-v{#Version}
Compression=lzma
SolidCompression=yes
UninstallDisplayIcon={app}\Aurora.exe
SetupIconFile=Aurora_updater.ico
WizardImageFile=Aurora-wizard.bmp
CloseApplications=yes

//#include <idp.iss>

[Messages]
WelcomeLabel2=This will install Aurora on your computer.%n%nAurora is a utility that unifies RGB lighting devices across different brands and enables them to work alongside each other, all while adding and improving RGB lighting support for various games that previous had none or little RGB lighting support.

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

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

[Files]
//Source: "unzipper.dll"; Flags: dontcopy
Source: "..\Build\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
//AfterInstall: ExtractMe('{app}\Aurora-v{#Version}.zip', '{app}')
Source: "vcredist_x86.exe"; DestDir: "{tmp}"; Flags: deleteafterinstall
Source: "vcredist_x64.exe"; DestDir: "{tmp}"; Flags: deleteafterinstall

[Icons]
Name: "{commonprograms}\Aurora"; Filename: "{app}\Aurora.exe"
Name: "{commondesktop}\Aurora"; Filename: "{app}\Aurora.exe"; Tasks: desktopicon

[Code]
//procedure unzip(src, target: AnsiString);
//external 'unzip@files:unzipper.dll stdcall delayload';

//procedure ExtractMe(src, target : String);
//begin
//  unzip(ExpandConstant(src), ExpandConstant(target));
//end;

procedure TaskKill(FileName: String);
var
  ResultCode: Integer;
begin
    Exec(ExpandConstant('taskkill.exe'), '/f /im ' + '"' + FileName + '"', '', SW_HIDE,
     ewWaitUntilTerminated, ResultCode);
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
  case CurStep of
    ssInstall:
      begin
        MsgBox(ExpandConstant('The setup will now try to close running instances of Aurora if there are any. Please save your work.'), mbConfirmation, MB_OK or MB_DEFBUTTON2);
        TaskKill('Aurora.exe');
        TaskKill('Aurora-SkypeIntegration.exe');
        TaskKill('Aurora-Updater.exe');
      end;
  end;
end;

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  case CurUninstallStep of
    usUninstall:
      begin
        MsgBox(ExpandConstant('The setup will now try to close running instances of Aurora if there are any. Please save your work.'), mbConfirmation, MB_OK or MB_DEFBUTTON2);
        TaskKill('Aurora.exe');
        TaskKill('Aurora-SkypeIntegration.exe');
        TaskKill('Aurora-Updater.exe');

        if MsgBox(ExpandConstant('Do you want to remove all the settings?'), mbConfirmation, MB_YESNO or MB_DEFBUTTON2) = IDYES then
          begin
             DelTree(ExpandConstant('{userappdata}\Aurora'), True, True, True);
          end
      end;
  end;
end;

#IFDEF UNICODE
  #DEFINE AW "W"
#ELSE
  #DEFINE AW "A"
#ENDIF

function VCRedistX64NeedsInstall: Boolean;
begin
  Result := not RegKeyExists(HKEY_LOCAL_MACHINE,'SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\x64');
end;

function VCRedistX86NeedsInstall: Boolean;
begin
  Result := not RegKeyExists(HKEY_LOCAL_MACHINE,'SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\x86');
end;

[Run]
Filename: "{app}\Aurora.exe"; Flags: nowait postinstall skipifsilent runascurrentuser; Description: "{cm:LaunchProgram,Aurora}"
Filename: "{tmp}\vcredist_x86.exe"; Check: VCRedistX86NeedsInstall
Filename: "{tmp}\vcredist_x64.exe"; Check: VCRedistX64NeedsInstall and IsWin64

[UninstallDelete]
;This works only if it is installed in default location
Type: filesandordirs; Name: "{pf}\Aurora"

;This works if it is installed in custom location
Type: files; Name: "{app}\*";
Type: filesandordirs; Name: "{app}"

#define public Version "0.6.1"

#ifdef EXTERNAL_VERSION
 #if len(EXTERNAL_VERSION)>0
     #define public Version EXTERNAL_VERSION
 #endif
#endif

[Setup]
AppId={{9444602B-C5D8-4EF5-9D5B-E76D06B53C71}
AppName=Aurora
AppVersion=v{#Version}
AppVerName=Aurora v{#Version}
AppPublisher=Anton Pupkov
AppPublisherURL=http://www.project-aurora.com/
AppSupportURL=https://github.com/antonpup/Aurora/issues/
AppUpdatesURL=https://github.com/antonpup/Aurora/releases
DefaultDirName={pf64}\Aurora
DisableProgramGroupPage=yes
DisableWelcomePage=no
OutputDir=..\
OutputBaseFilename=Aurora-setup-v{#Version}
Compression=lzma
SolidCompression=yes
UninstallDisplayIcon={app}\Aurora.exe
SetupIconFile=Aurora_updater.ico
WizardImageFile=Aurora-wizard.bmp

//#include <idp.iss>

[Messages]
WelcomeLabel2=This will install Aurora on your computer.%n%nAurora is a utility that unifies RGB lighting devices across different brands and enables them to work alongside each other, all while adding and improving RGB lighting support for various games that previous had none or little RGB lighting support.

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

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

[Files]
//Source: "unzipper.dll"; Flags: dontcopy
Source: "..\Build\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
//AfterInstall: ExtractMe('{app}\Aurora-v{#Version}.zip', '{app}')
Source: "vcredist_x86.exe"; DestDir: "{tmp}"; Flags: deleteafterinstall
Source: "vcredist_x64.exe"; DestDir: "{tmp}"; Flags: deleteafterinstall

[Icons]
Name: "{commonprograms}\Aurora"; Filename: "{app}\Aurora.exe"
Name: "{commondesktop}\Aurora"; Filename: "{app}\Aurora.exe"; Tasks: desktopicon

[Code]
//procedure unzip(src, target: AnsiString);
//external 'unzip@files:unzipper.dll stdcall delayload';

//procedure ExtractMe(src, target : String);
//begin
//  unzip(ExpandConstant(src), ExpandConstant(target));
//end;

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  case CurUninstallStep of
    usUninstall:
      begin
        if MsgBox(ExpandConstant('Do you want to remove all the settings?'), mbConfirmation, MB_YESNO or MB_DEFBUTTON2) = IDYES then
          begin
             DelTree(ExpandConstant('{userappdata}\Aurora'), True, True, True);
          end
      end;
  end;
end;

#IFDEF UNICODE
  #DEFINE AW "W"
#ELSE
  #DEFINE AW "A"
#ENDIF
function VCRedistX64NeedsInstall: Boolean;
begin
  Result := not RegKeyExists(HKEY_CLASSES_ROOT,'Installer\Dependencies\,,amd64,14.0,bundle\Dependents\{5b295ba9-ef89-4aeb-8acc-b61adb0b9b5f}');
end;

function VCRedistX86NeedsInstall: Boolean;
begin
  Result := not RegKeyExists(HKEY_CLASSES_ROOT,'Installer\Dependencies\,,x86,14.0,bundle\Dependents\{ec9c2282-a836-48a6-9e41-c2f0bf8d678b}');
end;

[Run]
Filename: "{app}\Aurora.exe"; Flags: nowait postinstall skipifsilent runascurrentuser; Description: "{cm:LaunchProgram,Aurora}"
Filename: "{tmp}\vcredist_x86.exe"; Check: VCRedistX86NeedsInstall
Filename: "{tmp}\vcredist_x64.exe"; Check: VCRedistX64NeedsInstall and IsWin64

[UninstallDelete]
;This works only if it is installed in default location
Type: filesandordirs; Name: "{pf}\Aurora"

;This works if it is installed in custom location
Type: files; Name: "{app}\*";
Type: filesandordirs; Name: "{app}"


Fix InnoSetup script to properly detect and install .NET 4 if needed

// Define stuff we need to download/update/install

//#define use_iis
//#define use_kb835732
//#define use_kb886903
//#define use_kb928366

//#define use_msi20
//#define use_msi31
#define use_msi45
//#define use_ie6

//#define use_dotnetfx11
// German languagepack?
//#define use_dotnetfx11lp

//#define use_dotnetfx20
// German languagepack?
//#define use_dotnetfx20lp

//#define use_dotnetfx35
// German languagepack?
//#define use_dotnetfx35lp

// dotnet_Passive enabled shows the .NET/VC2010 installation progress, as it can take quite some time
#define dotnet_Passive
#define use_dotnetfx40full
#define use_vc2010

//#define use_mdac28
//#define use_jet4sp8
// SQL 3.5 Compact Edition
//#define use_scceruntime
// SQL Express
//#define use_sql2005express
//#define use_sql2008express

// Enable the required define(s) below if a local event function (prepended with Local) is used
//#define haveLocalPrepareToInstall
//#define haveLocalNeedRestart
//#define haveLocalNextButtonClick

// End

#define MyAppSetupName 'NBA Stats Tracker'
#define MyAppVersion ''
#define MyAppVerInfo ''
#define CompiledPath 'E:\Development\Visual Studio 2010\Projects\NBA Stats Tracker\NBA Stats Tracker\bin\Release'
[Setup]
AppName={#MyAppSetupName}
AppVersion={#MyAppVersion}
AppVerName={#MyAppSetupName} {#MyAppVersion} {#MyAppVerInfo}
AppCopyright=Copyright  Lefteris Aslanoglou 2011-2013
VersionInfoVersion={#MyAppVersion}
VersionInfoCompany=Lefteris Aslanoglou
AppPublisher=Lefteris Aslanoglou
;AppPublisherURL=http://...
;AppSupportURL=http://...
;AppUpdatesURL=http://...
OutputBaseFilename={#MyAppSetupName} {#MyAppVersion} {#MyAppVerInfo}
DefaultGroupName={#MyAppSetupName}
DefaultDirName={code:GetDefaultDir}
UninstallDisplayIcon={app}\NBA Stats Tracker.exe
UninstallDisplayName={#MyAppSetupName}
Uninstallable=true
DirExistsWarning=no
CreateAppDir=true
OutputDir=..
SourceDir=.
AllowNoIcons=yes
UsePreviousGroup=yes
UsePreviousAppDir=yes
LanguageDetectionMethod=uilanguage
InternalCompressLevel=ultra
SolidCompression=yes
Compression=lzma/ultra
MinVersion=0,5.01
PrivilegesRequired=admin
ArchitecturesAllowed=x86 x64 ia64
ArchitecturesInstallIn64BitMode=x64 ia64
AppSupportURL=http://forums.nba-live.com/viewtopic.php?f=143&t=84110
AppUpdatesURL=http://forums.nba-live.com/viewtopic.php?f=143&t=84110

[Languages]
Name: "en"; MessagesFile: "compiler:Default.isl"

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

[Files]
Source: "{#CompiledPath}\*"; DestDir: "{app}"; Flags: ignoreversion; Excludes: "*.vshost.*,*.xml,*.pdb"
Source: "{#CompiledPath}\NBA Stats Tracker.pdb"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#CompiledPath}\LeftosCommonLibrary.pdb"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#CompiledPath}\SQLiteDatabase.pdb"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#CompiledPath}\Updater.pdb"; DestDir: "{app}"; Flags: ignoreversion

[Icons]
Name: "{group}\NBA Stats Tracker"; Filename: "{app}\NBA Stats Tracker.exe"; WorkingDir: "{app}"; IconFilename: "{app}\NBA Stats Tracker.exe"
Name: "{group}\{cm:UninstallProgram,NBA Stats Tracker}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\NBA Stats Tracker"; Filename: "{app}\NBA Stats Tracker.exe"; WorkingDir: "{app}"; IconFilename: "{app}\NBA Stats Tracker.exe"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\NBA Stats Tracker"; Filename: "{app}\NBA Stats Tracker.exe"; WorkingDir: "{app}"; IconFilename: "{app}\NBA Stats Tracker.exe"; Tasks: quicklaunchicon

[Run]
Filename: "{app}\NBA Stats Tracker.exe"; WorkingDir: "{app}"; Flags: nowait postinstall runascurrentuser skipifsilent; Description: "{cm:LaunchProgram,NBA Stats Tracker}"

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

[Registry]
Root: "HKCU"; Subkey: "Software\Lefteris Aslanoglou\NBA Stats Tracker"; Flags: uninsdeletekey
Root: "HKCU"; Subkey: "Software\Lefteris Aslanoglou\NBA Stats Tracker"; ValueType: string; ValueName: "InstallDir"; ValueData: "{app}"

[Dirs]
Name: "{app}\Images"

#include "scripts\products.iss"

#include "scripts\products\winversion.iss"
#include "scripts\products\fileversion.iss"

#ifdef use_iis
#include "scripts\products\iis.iss"
#endif

#ifdef use_kb835732
#include "scripts\products\kb835732.iss"
#endif
#ifdef use_kb886903
#include "scripts\products\kb886903.iss"
#endif
#ifdef use_kb928366
#include "scripts\products\kb928366.iss"
#endif

#ifdef use_msi20
#include "scripts\products\msi20.iss"
#endif
#ifdef use_msi31
#include "scripts\products\msi31.iss"
#endif
#ifdef use_msi45
#include "scripts\products\msi45.iss"
#endif
#ifdef use_ie6
#include "scripts\products\ie6.iss"
#endif

#ifdef use_dotnetfx11
#include "scripts\products\dotnetfx11.iss"
#include "scripts\products\dotnetfx11lp.iss"
#include "scripts\products\dotnetfx11sp1.iss"
#endif

#ifdef use_dotnetfx20
#include "scripts\products\dotnetfx20.iss"
#ifdef use_dotnetfx20lp
#include "scripts\products\dotnetfx20lp.iss"
#endif
#include "scripts\products\dotnetfx20sp1.iss"
#ifdef use_dotnetfx20lp
#include "scripts\products\dotnetfx20sp1lp.iss"
#endif
#include "scripts\products\dotnetfx20sp2.iss"
#ifdef use_dotnetfx20lp
#include "scripts\products\dotnetfx20sp2lp.iss"
#endif
#endif

#ifdef use_dotnetfx35
#include "scripts\products\dotnetfx35.iss"
#ifdef use_dotnetfx35lp
#include "scripts\products\dotnetfx35lp.iss"
#endif
#include "scripts\products\dotnetfx35sp1.iss"
#ifdef use_dotnetfx35lp
#include "scripts\products\dotnetfx35sp1lp.iss"
#endif
#endif

#ifdef use_dotnetfx40client
#include "scripts\products\dotnetfx40client.iss"
#endif
#ifdef use_dotnetfx40full
#include "scripts\products\dotnetfx40full.iss"
#endif
#ifdef use_vc2010
#include "scripts\products\vc2010.iss"
#endif

#ifdef use_mdac28
#include "scripts\products\mdac28.iss"
#endif
#ifdef use_jet4sp8
#include "scripts\products\jet4sp8.iss"
#endif
// SQL 3.5 Compact Edition
#ifdef use_scceruntime
#include "scripts\products\scceruntime.iss"
#endif
// SQL Express
#ifdef use_sql2005express
#include "scripts\products\sql2005express.iss"
#endif
#ifdef use_sql2008express
#include "scripts\products\sql2008express.iss"
#endif

[CustomMessages]
win2000sp3_title=Windows 2000 Service Pack 3
winxpsp2_title=Windows XP Service Pack 2
winxpsp3_title=Windows XP Service Pack 3

#expr SaveToFile(AddBackslash(SourcePath) + "Preprocessed"+MyAppSetupname+".iss")

[PostCompile]

[Code]
function InitializeSetup(): Boolean;
begin
	//init windows version
	initwinversion();

	//check if dotnetfx20 can be installed on this OS
	//if not minwinspversion(5, 0, 3) then begin
	//	MsgBox(FmtMessage(CustomMessage('depinstall_missing'), [CustomMessage('win2000sp3_title')]), mbError, MB_OK);
	//	exit;
	//end;
	if not minwinspversion(5, 1, 3) then begin
		MsgBox(FmtMessage(CustomMessage('depinstall_missing'), [CustomMessage('winxpsp3_title')]), mbError, MB_OK);
		exit;
	end;

#ifdef use_iis
	if (not iis()) then exit;
#endif

#ifdef use_msi20
	msi20('2.0');
#endif
#ifdef use_msi31
	msi31('3.1');
#endif
#ifdef use_msi45
	msi45('4.5');
#endif
#ifdef use_ie6
	ie6('5.0.2919');
#endif

#ifdef use_dotnetfx11
	dotnetfx11();
#ifdef use_dotnetfx11lp
	dotnetfx11lp();
#endif
	dotnetfx11sp1();
#endif
#ifdef use_kb886903
	kb886903(); //better use windows update
#endif
#ifdef use_kb928366
	kb928366(); //better use windows update
#endif

	//install .netfx 2.0 sp2 if possible; if not sp1 if possible; if not .netfx 2.0
#ifdef use_dotnetfx20
	if minwinversion(5, 1) then begin
		dotnetfx20sp2();
#ifdef use_dotnetfx20lp
		dotnetfx20sp2lp();
#endif
	end else begin
		if minwinversion(5, 0) and minwinspversion(5, 0, 4) then begin
#ifdef use_kb835732
			kb835732();
#endif
			dotnetfx20sp1();
#ifdef use_dotnetfx20lp
			dotnetfx20sp1lp();
#endif
		end else begin
			dotnetfx20();
#ifdef use_dotnetfx20lp
			dotnetfx20lp();
#endif
		end;
	end;
#endif

#ifdef use_dotnetfx35
	dotnetfx35();
#ifdef use_dotnetfx35lp
	dotnetfx35lp();
#endif
	dotnetfx35sp1();
#ifdef use_dotnetfx35lp
	dotnetfx35sp1lp();
#endif
#endif

#ifdef use_dotnetfx40full
	dotnetfx40full(false);
#endif

#ifdef use_dotnetfx40client
  dotnetfx40client(false);
#endif

	// Visual C++ 2010 Redistributable
#ifdef use_vc2010
	vc2010();
#endif

#ifdef use_mdac28
	mdac28('2.7');
#endif
#ifdef use_jet4sp8
	jet4sp8('4.0.8015');
#endif
	// SQL 3.5 CE
#ifdef use_ssceruntime
	ssceruntime();
#endif
	// SQL Express
#ifdef use_sql2005express
	sql2005express();
#endif
#ifdef use_sql2008express
	sql2008express();
#endif

	Result := true;
end;

function GetDefaultDir(def: string): string;
var
sTemp : string;
begin
    //Set a defualt value so that the install doesn't fail.
    sTemp := ExpandConstant('{pf32}') + '\NBA Stats Tracker';

    //We need to get the current install directory.
    if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\Lefteris Aslanoglou\NBA Stats Tracker',
     'InstallDir', sTemp) then
     begin
    //We found the value in the registry so we'll use that.  Otherwise we use the default
     end;
    Result := sTemp;
end;

// Define stuff we need to download/update/install

//#define use_iis
//#define use_kb835732
//#define use_kb886903
//#define use_kb928366

//#define use_msi20
//#define use_msi31
#define use_msi45
//#define use_ie6

//#define use_dotnetfx11
// German languagepack?
//#define use_dotnetfx11lp

//#define use_dotnetfx20
// German languagepack?
//#define use_dotnetfx20lp

//#define use_dotnetfx35
// German languagepack?
//#define use_dotnetfx35lp

// dotnet_Passive enabled shows the .NET/VC2010 installation progress, as it can take quite some time
#define dotnet_Passive
#define use_dotnetfx40full
#define use_vc2010

//#define use_mdac28
//#define use_jet4sp8
// SQL 3.5 Compact Edition
//#define use_scceruntime
// SQL Express
//#define use_sql2005express
//#define use_sql2008express

// Enable the required define(s) below if a local event function (prepended with Local) is used
//#define haveLocalPrepareToInstall
//#define haveLocalNeedRestart
//#define haveLocalNextButtonClick

// End

#define MyAppSetupName 'NBA Stats Tracker'
#define MyAppVersion ''
#define MyAppVerInfo ''
#define CompiledPath 'E:\Development\Visual Studio 2010\Projects\NBA Stats Tracker\NBA Stats Tracker\bin\Release'
[Setup]
AppName={#MyAppSetupName}
AppVersion={#MyAppVersion}
AppVerName={#MyAppSetupName} {#MyAppVersion} {#MyAppVerInfo}
AppCopyright=Copyright  Lefteris Aslanoglou 2011-2013
VersionInfoVersion={#MyAppVersion}
VersionInfoCompany=Lefteris Aslanoglou
AppPublisher=Lefteris Aslanoglou
;AppPublisherURL=http://...
;AppSupportURL=http://...
;AppUpdatesURL=http://...
OutputBaseFilename={#MyAppSetupName} {#MyAppVersion} {#MyAppVerInfo}
DefaultGroupName={#MyAppSetupName}
DefaultDirName={code:GetDefaultDir}
UninstallDisplayIcon={app}\NBA Stats Tracker.exe
UninstallDisplayName={#MyAppSetupName}
Uninstallable=true
DirExistsWarning=no
CreateAppDir=true
OutputDir=..
SourceDir=.
AllowNoIcons=yes
UsePreviousGroup=yes
UsePreviousAppDir=yes
LanguageDetectionMethod=uilanguage
InternalCompressLevel=ultra
SolidCompression=yes
Compression=lzma/ultra
MinVersion=0,5.01
PrivilegesRequired=admin
ArchitecturesAllowed=x86 x64 ia64
ArchitecturesInstallIn64BitMode=x64 ia64
AppSupportURL=http://forums.nba-live.com/viewtopic.php?f=143&t=84110
AppUpdatesURL=http://forums.nba-live.com/viewtopic.php?f=143&t=84110

[Languages]
Name: "en"; MessagesFile: "compiler:Default.isl"

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

[Files]
Source: "{#CompiledPath}\*"; DestDir: "{app}"; Flags: ignoreversion; Excludes: "*.vshost.*,*.xml,*.pdb"
Source: "{#CompiledPath}\NBA Stats Tracker.pdb"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#CompiledPath}\LeftosCommonLibrary.pdb"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#CompiledPath}\SQLiteDatabase.pdb"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#CompiledPath}\Updater.pdb"; DestDir: "{app}"; Flags: ignoreversion

[Icons]
Name: "{group}\NBA Stats Tracker"; Filename: "{app}\NBA Stats Tracker.exe"; WorkingDir: "{app}"; IconFilename: "{app}\NBA Stats Tracker.exe"
Name: "{group}\{cm:UninstallProgram,NBA Stats Tracker}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\NBA Stats Tracker"; Filename: "{app}\NBA Stats Tracker.exe"; WorkingDir: "{app}"; IconFilename: "{app}\NBA Stats Tracker.exe"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\NBA Stats Tracker"; Filename: "{app}\NBA Stats Tracker.exe"; WorkingDir: "{app}"; IconFilename: "{app}\NBA Stats Tracker.exe"; Tasks: quicklaunchicon

[Run]
Filename: "{app}\NBA Stats Tracker.exe"; WorkingDir: "{app}"; Flags: nowait postinstall runascurrentuser skipifsilent; Description: "{cm:LaunchProgram,NBA Stats Tracker}"

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

[Registry]
Root: "HKCU"; Subkey: "Software\Lefteris Aslanoglou\NBA Stats Tracker"; Flags: uninsdeletekey
Root: "HKCU"; Subkey: "Software\Lefteris Aslanoglou\NBA Stats Tracker"; ValueType: string; ValueName: "InstallDir"; ValueData: "{app}"

[Dirs]
Name: "{app}\Images"

#include "scripts\products.iss"

#include "scripts\products\winversion.iss"
#include "scripts\products\fileversion.iss"

#ifdef use_iis
#include "scripts\products\iis.iss"
#endif

#ifdef use_kb835732
#include "scripts\products\kb835732.iss"
#endif
#ifdef use_kb886903
#include "scripts\products\kb886903.iss"
#endif
#ifdef use_kb928366
#include "scripts\products\kb928366.iss"
#endif

#ifdef use_msi20
#include "scripts\products\msi20.iss"
#endif
#ifdef use_msi31
#include "scripts\products\msi31.iss"
#endif
#ifdef use_msi45
#include "scripts\products\msi45.iss"
#endif
#ifdef use_ie6
#include "scripts\products\ie6.iss"
#endif

#ifdef use_dotnetfx11
#include "scripts\products\dotnetfx11.iss"
#include "scripts\products\dotnetfx11lp.iss"
#include "scripts\products\dotnetfx11sp1.iss"
#endif

#ifdef use_dotnetfx20
#include "scripts\products\dotnetfx20.iss"
#ifdef use_dotnetfx20lp
#include "scripts\products\dotnetfx20lp.iss"
#endif
#include "scripts\products\dotnetfx20sp1.iss"
#ifdef use_dotnetfx20lp
#include "scripts\products\dotnetfx20sp1lp.iss"
#endif
#include "scripts\products\dotnetfx20sp2.iss"
#ifdef use_dotnetfx20lp
#include "scripts\products\dotnetfx20sp2lp.iss"
#endif
#endif

#ifdef use_dotnetfx35
#include "scripts\products\dotnetfx35.iss"
#ifdef use_dotnetfx35lp
#include "scripts\products\dotnetfx35lp.iss"
#endif
#include "scripts\products\dotnetfx35sp1.iss"
#ifdef use_dotnetfx35lp
#include "scripts\products\dotnetfx35sp1lp.iss"
#endif
#endif

#ifdef use_dotnetfx40client
#include "scripts\products\dotnetfx40client.iss"
#endif
#ifdef use_dotnetfx40full
#include "scripts\products\dotnetfx40full.iss"
#endif
#ifdef use_vc2010
#include "scripts\products\vc2010.iss"
#endif

#ifdef use_mdac28
#include "scripts\products\mdac28.iss"
#endif
#ifdef use_jet4sp8
#include "scripts\products\jet4sp8.iss"
#endif
// SQL 3.5 Compact Edition
#ifdef use_scceruntime
#include "scripts\products\scceruntime.iss"
#endif
// SQL Express
#ifdef use_sql2005express
#include "scripts\products\sql2005express.iss"
#endif
#ifdef use_sql2008express
#include "scripts\products\sql2008express.iss"
#endif

[CustomMessages]
win2000sp3_title=Windows 2000 Service Pack 3
winxpsp2_title=Windows XP Service Pack 2
winxpsp3_title=Windows XP Service Pack 3

#expr SaveToFile(AddBackslash(SourcePath) + "Preprocessed"+MyAppSetupname+".iss")

[PostCompile]

[Code]
function InitializeSetup(): Boolean;
begin
	//init windows version
	initwinversion();

	//check if dotnetfx20 can be installed on this OS
	//if not minwinspversion(5, 0, 3) then begin
	//	MsgBox(FmtMessage(CustomMessage('depinstall_missing'), [CustomMessage('win2000sp3_title')]), mbError, MB_OK);
	//	exit;
	//end;
	if not minwinspversion(5, 1, 3) then begin
		MsgBox(FmtMessage(CustomMessage('depinstall_missing'), [CustomMessage('winxpsp3_title')]), mbError, MB_OK);
		exit;
	end;

#ifdef use_iis
	if (not iis()) then exit;
#endif

#ifdef use_msi20
	msi20('2.0');
#endif
#ifdef use_msi31
	msi31('3.1');
#endif
#ifdef use_msi45
	msi45('4.5');
#endif
#ifdef use_ie6
	ie6('5.0.2919');
#endif

#ifdef use_dotnetfx11
	dotnetfx11();
#ifdef use_dotnetfx11lp
	dotnetfx11lp();
#endif
	dotnetfx11sp1();
#endif
#ifdef use_kb886903
	kb886903(); //better use windows update
#endif
#ifdef use_kb928366
	kb928366(); //better use windows update
#endif

	//install .netfx 2.0 sp2 if possible; if not sp1 if possible; if not .netfx 2.0
#ifdef use_dotnetfx20
	if minwinversion(5, 1) then begin
		dotnetfx20sp2();
#ifdef use_dotnetfx20lp
		dotnetfx20sp2lp();
#endif
	end else begin
		if minwinversion(5, 0) and minwinspversion(5, 0, 4) then begin
#ifdef use_kb835732
			kb835732();
#endif
			dotnetfx20sp1();
#ifdef use_dotnetfx20lp
			dotnetfx20sp1lp();
#endif
		end else begin
			dotnetfx20();
#ifdef use_dotnetfx20lp
			dotnetfx20lp();
#endif
		end;
	end;
#endif

#ifdef use_dotnetfx35
	dotnetfx35();
#ifdef use_dotnetfx35lp
	dotnetfx35lp();
#endif
	dotnetfx35sp1();
#ifdef use_dotnetfx35lp
	dotnetfx35sp1lp();
#endif
#endif

	// If no .NET 4.0 framework found, install the smallest
#ifdef use_dotnetfx40
	if not dotnetfx40client(true) then
	    if not dotnetfx40full(true) then
	        dotnetfx40client(false);
	// Alternatively:
	// dotnetfx40full();
#endif

	// Visual C++ 2010 Redistributable
#ifdef use_vc2010
	vc2010();
#endif

#ifdef use_mdac28
	mdac28('2.7');
#endif
#ifdef use_jet4sp8
	jet4sp8('4.0.8015');
#endif
	// SQL 3.5 CE
#ifdef use_ssceruntime
	ssceruntime();
#endif
	// SQL Express
#ifdef use_sql2005express
	sql2005express();
#endif
#ifdef use_sql2008express
	sql2008express();
#endif

	Result := true;
end;

function GetDefaultDir(def: string): string;
var
sTemp : string;
begin
    //Set a defualt value so that the install doesn't fail.
    sTemp := ExpandConstant('{pf32}') + '\NBA Stats Tracker';

    //We need to get the current install directory.
    if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\Lefteris Aslanoglou\NBA Stats Tracker',
     'InstallDir', sTemp) then
     begin
    //We found the value in the registry so we'll use that.  Otherwise we use the default
     end;
    Result := sTemp;
end;