[Setup]
AppId={{B7CBF4E7-9E8F-4A5B-9B73-7B7E5D5D5E6A}}
AppName=ClassicNotepad
AppVersion=1.1.0
AppPublisher=ClassicNotepad
DefaultDirName={autopf}\ClassicNotepad
DefaultGroupName=ClassicNotepad
OutputBaseFilename=ClassicNotepadSetup
SetupIconFile=app.ico
UninstallDisplayIcon={app}\ClassicNotepad.exe
ArchitecturesAllowed=x86 x64
ArchitecturesInstallIn64BitMode=x64
PrivilegesRequired=lowest
ChangesAssociations=yes

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

[Tasks]
Name: "desktopicon"; Description: "Create a &desktop icon"; Flags: unchecked
Name: "assoc"; Description: "Set ClassicNotepad as the default for .txt files"; Flags: unchecked

[Files]
Source: "ClassicNotepad.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "notepad.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "app.ico"; DestDir: "{app}"; Flags: ignoreversion

[Icons]
Name: "{autoprograms}\ClassicNotepad"; Filename: "{app}\ClassicNotepad.exe"; IconFilename: "{app}\app.ico"
Name: "{autoprograms}\Notepad (ClassicNotepad)"; Filename: "{app}\ClassicNotepad.exe"; IconFilename: "{app}\app.ico"
Name: "{autoprograms}\Notepad"; Filename: "{app}\notepad.exe"; IconFilename: "{app}\app.ico"
Name: "{autodesktop}\ClassicNotepad"; Filename: "{app}\ClassicNotepad.exe"; Tasks: desktopicon; IconFilename: "{app}\app.ico"

[Registry]
; Associate .txt with ClassicNotepad (per-user)
Root: HKCU; Subkey: "Software\Classes\.txt"; ValueType: string; ValueName: ""; ValueData: "ClassicNotepad.txt"; Tasks: assoc; Flags: uninsdeletevalue
Root: HKCU; Subkey: "Software\Classes\ClassicNotepad.txt"; ValueType: string; ValueData: "Text Document"; Tasks: assoc; Flags: uninsdeletekey
Root: HKCU; Subkey: "Software\Classes\ClassicNotepad.txt\DefaultIcon"; ValueType: string; ValueData: "{app}\ClassicNotepad.exe,0"; Tasks: assoc; Flags: uninsdeletekey
Root: HKCU; Subkey: "Software\Classes\ClassicNotepad.txt\shell\open\command"; ValueType: string; ValueData: """{app}\ClassicNotepad.exe"" ""%1"""; Tasks: assoc; Flags: uninsdeletekey
