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

[Setup]
AppName=SetupS
AppVerName=SetupS SendTo Suite v#ProjectVersion#
VersionInfoVersion=#ProjectVersion#
AppVersion=#ProjectVersion#
AppPublisher=#cHolder# 
AppPublisherURL=#WebLink1#
AppSupportURL=#WebLink1#
AppUpdatesURL=#WebSite1#
DefaultDirName={pf}\SetupS.SendTo
DisableDirPage=true
DefaultGroupName=SetupS SendTo
UsePreviousAppDir=No
DisableProgramGroupPage=yes
ChangesAssociations=yes
OutputBaseFilename=Install.SetupS_v#ProjectVersion#
Compression=lzma2/ultra64
SolidCompression=true
InternalCompressLevel=ultra64
OutputDir=..\Source.Code\Inno.Output
ArchitecturesInstallIn64BitMode=x64

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

[Files]
Source: ssApp.app; DestDir: {app}; Flags: ignoreversion
Source: ssApp.cmd; DestDir: {app}; Flags: ignoreversion
Source: ssApp.ico; DestDir: {app}; Flags: ignoreversion
Source: ssApp.png; DestDir: {app}; Flags: ignoreversion
Source: ssApp.jpg; DestDir: {app}; Flags: ignoreversion
Source: folder.jpg; DestDir: {app}; Flags: ignoreversion
Source: ssConfig.ini; DestDir: {app}; Flags: ignoreversion
Source: ssUpdate.ini; DestDir: {app}; Flags: ignoreversion
Source: Category.ini; DestDir: {app}; Flags: ignoreversion
Source: MenuDefaults.ini; DestDir: {app}; Flags: ignoreversion
Source: Tools\SetupS.exe; DestDir: {app}; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: Tools\SetupS_x64.exe; DestDir: {app}; DestName: SetupS.exe; Flags: ignoreversion; Check: Is64BitInstallMode
Source: Tools\ssRegenerator.exe; DestDir: {app}; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: Tools\ssRegenerator_x64.exe; DestDir: {app}; DestName: ssRegenerator.exe; Flags: ignoreversion; Check: Is64BitInstallMode
Source: Tools\ssControlPanel.exe; DestDir: {app}; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: Tools\ssControlPanel_x64.exe; DestDir: {app}; DestName: ssControlPanel.exe; Flags: ignoreversion; Check: Is64BitInstallMode
Source: Tools\SetupScp.exe; DestDir: {app}; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: Tools\ssCP.exe; DestDir: {app}; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: Tools\Regenerator.exe; DestDir: {app}; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: Tools\ssRegen.exe; DestDir: {app}; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: Tools\ssTek.chm; DestDir: {app}; Flags: ignoreversion
Source: ssEditor\ssEditor.exe; DestDir: {app}\ssEditor; Flags: ignoreversion; Check: not Is64BitInstallMode
Source: ssEditor\ssEditor_x64.exe; DestDir: {app}\ssEditor; DestName: ssEditor.exe; Flags: ignoreversion; Check: Is64BitInstallMode
Source: ssEditor\ssEditor.ini; DestDir: {app}\ssEditor; Flags: ignoreversion
Source: ssEditor\ssEditor.ico; DestDir: {app}\ssEditor; Flags: ignoreversion
Source: ssEditor\7z.Exclude.lst; DestDir: {app}\ssEditor; Flags: ignoreversion
Source: ssEditor\7z.SetupS.lst; DestDir: {app}\ssEditor; Flags: ignoreversion
Source: ssEditor\7z.nc.lst; DestDir: {app}\ssEditor; Flags: ignoreversion
Source: ssEditor\7z.PPMd.lst; DestDir: {app}\ssEditor; Flags: ignoreversion
Source: ssEditor\ASSF.ini; DestDir: {app}\ssEditor; Flags: ignoreversion
Source: ssEditor\templates\*.app; DestDir: {app}\ssEditor\templates; Flags: ignoreversion
Source: ssEditor\templates\*.ppg; DestDir: {app}\ssEditor\templates; Flags: ignoreversion
Source: ssEditor\bin\*.*; DestDir: {app}\ssEditor\bin; Flags: ignoreversion recursesubdirs createallsubdirs
Source: Tools\_x86\*.*; DestDir: {app}\Tools; Flags: ignoreversion recursesubdirs createallsubdirs; Check: not Is64BitInstallMode
Source: Tools\_x64\*.*; DestDir: {app}\Tools; Flags: ignoreversion recursesubdirs createallsubdirs; Check: Is64BitInstallMode
;Source: Tools\Fix_SetupS_Linux.bash; DestDir: {app}\Tools; Flags: ignoreversion
;Source: Tools\LinuxSendTo.exe; DestDir: {app}\Tools; Flags: ignoreversion
;Source: Tools\SetupS.tar.gz; DestDir: {app}\Tools; Flags: ignoreversion
Source: Tools\Tools.ico; DestDir: {app}\Tools; Flags: ignoreversion
Source: Tools\Menus\*.*; DestDir: {app}\Tools\Menus; Flags: ignoreversion recursesubdirs createallsubdirs
Source: Tools\FaderModules\*.*; DestDir: {app}\Tools\FaderModules; Flags: ignoreversion recursesubdirs createallsubdirs
Source: Tools\SetUserFTA\*.*; DestDir: {app}\Tools\SetUserFTA; Flags: ignoreversion recursesubdirs createallsubdirs
Source: Tools\Default\*.*; DestDir: {app}\Tools\Default; Flags: ignoreversion recursesubdirs createallsubdirs
Source: Licenses\*.*; DestDir: {app}\Licenses; Flags: ignoreversion recursesubdirs createallsubdirs

[Icons]
Name: {group}\SetupS Control Panel; Filename: {app}\ssControlPanel.exe; Comment: Applet to select an Advanced StartMenu/Sorting Style, ppDrives, etc.
Name: {group}\SetupS Editor; Filename: {app}\ssEditor\ssEditor.exe; Comment: Make your own SetupS/ppApp apps
Name: {group}\StartMenu Resorting\LastOS; Filename: {app}\ssControlPanel.exe; Parameters: -LastOS; Comment: Installs and resorts to the LastOS Advanced StartMenu sorting-structure.
Name: {group}\StartMenu Resorting\Kazz; Filename: {app}\ssControlPanel.exe; Parameters: -Kazz; Comment: Installs and resorts to the Kazz Advanced StartMenu sorting-structure.
Name: {group}\StartMenu Resorting\Standard; Filename: {app}\ssControlPanel.exe; Parameters: -Standard; Comment: Installs and resorts to the Standard StartMenu sorting-structure.
Name: {group}\StartMenu Resorting\Resort; Filename: {app}\ssControlPanel.exe; Parameters: -Resort; Comment: Resorts to the current StartMenu sorting-structure.
Name: {group}\ssCleaner\Clean StartMenu only; Filename: {app}\ssControlPanel.exe; Parameters: -ssClean=StartMenuOnly,NotDudInstallPaths,NoDeepScan; Comment: Clean dud shortcuts (Startmenu only).
Name: {group}\ssCleaner\Clean ALL dud Shortcuts; Filename: {app}\ssControlPanel.exe; Parameters: -ssClean=AllShortcuts,DudInstallPaths,DeepScan; Comment: Clean dud shortcuts (All shortcut locations).
Name: {group}\Regenerator\ssApps Regenerator; Filename: {app}\ssRegenerator.exe; Parameters: -ssApps; Comment: Create StartMenu Shortcuts for all your SetupS/ssApps
Name: {group}\Regenerator\ppApps Regenerator; Filename: {app}\ssRegenerator.exe; Parameters: -ppApps -AllDrives=no; Comment: Create StartMenu Shortcuts for all your ppApps
Name: {group}\Regenerator\ppGames Regenerator; Filename: {app}\ssRegenerator.exe; Parameters: -ppGames -AllDrives=no; Comment: Create StartMenu Shortcuts for all your ppGames
Name: {group}\Regenerator\All SetupS-tech Regenerator; Filename: {app}\ssRegenerator.exe; Parameters: -AllDrives=no; Comment: Create StartMenu Shortcuts for all your ssApps, ppApps, & ppGames
Name: {group}\Regenerator\All Drives\ppApps Regenerator (all drives); Filename: {app}\ssRegenerator.exe; Parameters: -ppApps -AllDrives=yes; Comment: Create StartMenu Shortcuts for all your ppApps on all your drives
Name: {group}\Regenerator\All Drives\ppGames Regenerator (all drives); Filename: {app}\ssRegenerator.exe; Parameters: -ppGames -AllDrives=yes; Comment: Create StartMenu Shortcuts for all your ppGames on all your drives
Name: {group}\Regenerator\All Drives\All SetupS-tech Regenerator (all drives); Filename: {app}\ssRegenerator.exe; Parameters: -AllDrives=yes; Comment: Create StartMenu Shortcuts for all your ssApps, ppApps, & ppGames on all your drives
Name: {group}\ssTek Help; Filename: {app}\ssTek.chm; Comment: General help-file for ssTek Tools.
Name: {sendto}\SetupS; Filename: {app}\SetupS.exe
Name: {sendto}\SetupS Editor; Filename: {app}\ssEditor\ssEditor.exe

Name: {sendto}\ssEditor(Autobuild Archive); Filename: {app}\ssEditor\ssEditor.exe; Parameters: -autobuild -MakeExpressInstaller=on
Name: {sendto}\ssEditor(Autobuild Folder); Filename: {app}\ssEditor\ssEditor.exe; Parameters: -autobuild -MakeExpressInstaller=off

Name: C:\Users\Default\AppData\Roaming\Microsoft\Windows\SendTo\SetupS; Filename: {app}\SetupS.exe
Name: C:\Users\Default\AppData\Roaming\Microsoft\Windows\SendTo\ssEditor(Autobuild Archive); Filename: {app}\ssEditor\ssEditor.exe; Parameters: -autobuild -MakeExpressInstaller=on
Name: C:\Users\Default\AppData\Roaming\Microsoft\Windows\SendTo\ssEditor(Autobuild Folder); Filename: {app}\ssEditor\ssEditor.exe; Parameters: -autobuild -MakeExpressInstaller=off



[Registry]
Root: HKCR; Subkey: .app; ValueType: string; ValueName: ; ValueData: SetupS.SendTo; Flags: uninsdeletevalue
Root: HKCR; Subkey: .ppg; ValueType: string; ValueName: ; ValueData: SetupS.SendTo; Flags: uninsdeletevalue
Root: HKCR; Subkey: .apz; ValueType: string; ValueName: ; ValueData: SetupS.SendTo; Flags: uninsdeletevalue
Root: HKCR; Subkey: .pgz; ValueType: string; ValueName: ; ValueData: SetupS.SendTo; Flags: uninsdeletevalue
Root: HKCR; Subkey: SetupS.SendTo\shell\open\command; ValueType: string; ValueName: ; ValueData: """{app}\SetupS.exe"" ""%1"""
Root: HKCR; Subkey: SetupS.SendTo\shell\edit\command; ValueType: string; ValueName: ; ValueData: """{app}\ssEditor\ssEditor.exe"" ""%1"""
Root: HKCR; Subkey: SetupS.SendTo; ValueType: string; ValueName: ; ValueData: SetupS.SendTo Silent Install; Flags: uninsdeletekey
Root: HKCR; Subkey: SetupS.SendTo\DefaultIcon; ValueType: string; ValueName: ; ValueData: {app}\SetupS.exe,0
Root: HKCU; Subkey: Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced; ValueType: dword; ValueName: EnableBalloonTips; ValueData: 00000002

;UAC protection overrides
Root: HKLM; Subkey: SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers; ValueType: string; ValueName: {app}\SetupS.exe; ValueData: RUNASADMIN
Root: HKLM; Subkey: SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers; ValueType: string; ValueName: {app}\ssRegenerator.exe; ValueData: RUNASADMIN
Root: HKLM; Subkey: SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers; ValueType: string; ValueName: {app}\ssControlPanel.exe; ValueData: RUNASADMIN
Root: HKLM; Subkey: SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers; ValueType: string; ValueName: {app}\ssEditor\ssEditor.exe; ValueData: RUNASADMIN
Root: HKLM; Subkey: SYSTEM\CurrentControlSet\services\PcaSvc; ValueType: dword; ValueName: Start; ValueData: 00000004; MinVersion: 0,6.0

[Run]
Filename: "{app}\ssControlPanel.exe"; Parameters: "-path=add"
;Filename: {app}\Tools\LinuxSendTo.exe; WorkingDir: {app}\Tools

[Code]
procedure CurStepChanged(CurStep: TSetupStep);
	var
		ResultCode: Integer;
		Uninstall: String;
	begin
		if (CurStep = ssInstall) then begin
			if RegQueryStringValue(HKLM, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\SetupS_is1', 'UninstallString', Uninstall) then begin
//				if MsgBox('Do you wish to Uninstall your present version of SetupS and continue with fresh installation?', mbConfirmation, MB_YESNO) = IDYES then begin
					Exec(RemoveQuotes(Uninstall), ' /SILENT', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);
//				end;
			end;
			if RegQueryStringValue(HKLM, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\Setup SetupS_is1', 'UninstallString', Uninstall) then begin
//				if MsgBox('Do you wish to Uninstall your present version of SetupS and continue with fresh installation?', mbConfirmation, MB_YESNO) = IDYES then begin
					Exec(RemoveQuotes(Uninstall), ' /SILENT', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);
//				end;
			end;
			if RegQueryStringValue(HKLM, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\SetupS.SendTo_is1', 'UninstallString', Uninstall) then begin
//				if MsgBox('Do you wish to Uninstall your present version of SetupS and continue with fresh installation?', mbConfirmation, MB_YESNO) = IDYES then begin
					Exec(RemoveQuotes(Uninstall), ' /SILENT', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);
//				end;
			end;
		end;
	end;

[UninstallRun]
Filename: "{app}\ssControlPanel.exe"; Parameters: "-path=del -ssUninstall=off"

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