diff --git a/TweetDuck.csproj b/TweetDuck.csproj index c0bb15c8..1fe969c2 100644 --- a/TweetDuck.csproj +++ b/TweetDuck.csproj @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="packages\CefSharp.WinForms.64.0.0-CI2508\build\CefSharp.WinForms.props" Condition="Exists('packages\CefSharp.WinForms.64.0.0-CI2508\build\CefSharp.WinForms.props')" /> <Import Project="packages\CefSharp.Common.64.0.0-CI2508\build\CefSharp.Common.props" Condition="Exists('packages\CefSharp.Common.64.0.0-CI2508\build\CefSharp.Common.props')" /> @@ -419,7 +419,6 @@ powershell -ExecutionPolicy Unrestricted -File "$(ProjectDir)Resources\PostBuild <Exec Command="del "$(TargetDir)*.pdb"" /> <Exec Command="del "$(TargetDir)*.xml"" /> <Delete Files="$(TargetDir)CefSharp.BrowserSubprocess.exe" /> - <Delete Files="$(TargetDir)devtools_resources.pak" /> <Delete Files="$(TargetDir)widevinecdmadapter.dll" /> </Target> <PropertyGroup> diff --git a/bld/gen_full.iss b/bld/gen_full.iss index f48b5c1c..698263a3 100644 --- a/bld/gen_full.iss +++ b/bld/gen_full.iss @@ -38,11 +38,13 @@ MinVersion=0,6.1 Name: "english"; MessagesFile: "compiler:Default.isl" [Tasks] -Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalTasks}"; Flags: unchecked +Name: "devtools"; Description: "{cm:TaskDevTools}"; GroupDescription: "{cm:AdditionalTasks}"; Flags: unchecked [Files] Source: "..\bin\x86\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion -Source: "..\bin\x86\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: "*.xml,*.pdb,CefSharp.BrowserSubprocess.exe,devtools_resources.pak,widevinecdmadapter.dll" +Source: "..\bin\x86\Release\devtools_resources.pak"; DestDir: "{app}"; Flags: ignoreversion; Tasks: devtools +Source: "..\bin\x86\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: "devtools_resources.pak" [Icons] Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Check: TDIsUninstallable @@ -58,9 +60,14 @@ Type: filesandordirs; Name: "{app}\scripts" Type: filesandordirs; Name: "{localappdata}\{#MyAppName}\Cache" Type: filesandordirs; Name: "{localappdata}\{#MyAppName}\GPUCache" +[CustomMessages] +AdditionalTasks=Additional shortcuts and components: +TaskDevTools=Install dev tools + [Code] var UpdatePath: String; var ForceRedistPrompt: String; +var VisitedTasksPage: Boolean; function TDGetNetFrameworkVersion: Cardinal; forward; function TDIsVCMissing: Boolean; forward; @@ -71,6 +78,7 @@ function InitializeSetup: Boolean; begin UpdatePath := ExpandConstant('{param:UPDATEPATH}') ForceRedistPrompt := ExpandConstant('{param:PROMPTREDIST}') + VisitedTasksPage := False if (TDGetNetFrameworkVersion() < 379893) and (MsgBox('{#MyAppName} requires .NET Framework 4.5.2 or newer,'+#13+#10+'please visit {#MyAppShortURL} for a download link.'+#13+#10+#13+#10'Do you want to proceed with the setup anyway?', mbCriticalError, MB_YESNO or MB_DEFBUTTON2) = IDNO) then begin @@ -106,12 +114,14 @@ begin Result := (PageID = wpSelectDir) and (UpdatePath <> '') end; -{ Check the desktop icon task if not updating. } +{ Check the desktop icon task if not updating, and dev tools task if already installed. } procedure CurPageChanged(CurPageID: Integer); begin - if CurPageID = wpSelectTasks then + if (CurPageID = wpSelectTasks) and (not VisitedTasksPage) then begin - WizardForm.TasksList.Checked[WizardForm.TasksList.Items.Count-1] := (UpdatePath = ''); + WizardForm.TasksList.Checked[WizardForm.TasksList.Items.Count-2] := (UpdatePath = '') + WizardForm.TasksList.Checked[WizardForm.TasksList.Items.Count-1] := FileExists(ExpandConstant('{app}\devtools_resources.pak')) + VisitedTasksPage := True end; end; diff --git a/bld/gen_port.iss b/bld/gen_port.iss index d97f824d..7069eeb7 100644 --- a/bld/gen_port.iss +++ b/bld/gen_port.iss @@ -37,16 +37,25 @@ MinVersion=0,6.1 [Languages] Name: "english"; MessagesFile: "compiler:Default.isl" +[Tasks] +Name: "devtools"; Description: "{cm:TaskDevTools}"; GroupDescription: "{cm:AdditionalTasks}"; Flags: unchecked + [Files] Source: "..\bin\x86\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion -Source: "..\bin\x86\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: "*.xml,*.pdb,CefSharp.BrowserSubprocess.exe,devtools_resources.pak,widevinecdmadapter.dll" +Source: "..\bin\x86\Release\devtools_resources.pak"; DestDir: "{app}"; Flags: ignoreversion; Tasks: devtools +Source: "..\bin\x86\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: "devtools_resources.pak" [Run] Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall shellexec skipifsilent +[CustomMessages] +AdditionalTasks=Additional components: +TaskDevTools=Install dev tools + [Code] var UpdatePath: String; var ForceRedistPrompt: String; +var VisitedTasksPage: Boolean; function TDGetNetFrameworkVersion: Cardinal; forward; function TDIsVCMissing: Boolean; forward; @@ -57,6 +66,7 @@ function InitializeSetup: Boolean; begin UpdatePath := ExpandConstant('{param:UPDATEPATH}') ForceRedistPrompt := ExpandConstant('{param:PROMPTREDIST}') + VisitedTasksPage := False if (TDGetNetFrameworkVersion() < 379893) and (MsgBox('{#MyAppName} requires .NET Framework 4.5.2 or newer,'+#13+#10+'please visit {#MyAppShortURL} for a download link.'+#13+#10+#13+#10'Do you want to proceed with the setup anyway?', mbCriticalError, MB_YESNO or MB_DEFBUTTON2) = IDNO) then begin @@ -92,6 +102,16 @@ begin Result := (PageID = wpSelectDir) and (UpdatePath <> '') end; +{ Check the dev tools task if already installed. } +procedure CurPageChanged(CurPageID: Integer); +begin + if (CurPageID = wpSelectTasks) and (not VisitedTasksPage) then + begin + WizardForm.TasksList.Checked[WizardForm.TasksList.Items.Count-1] := FileExists(ExpandConstant('{app}\devtools_resources.pak')) + VisitedTasksPage := True + end; +end; + { Install VC++ if downloaded, and create a 'makeportable' file for portable installs. } procedure CurStepChanged(CurStep: TSetupStep); begin