From c0c64f6d62ad4f7d687538e6c40eb60ee9c16595 Mon Sep 17 00:00:00 2001
From: chylex <contact@chylex.com>
Date: Wed, 14 Feb 2018 17:45:19 +0100
Subject: [PATCH] Remove old TweetDeck installation check from the installer &
 tweak formatting

---
 bld/gen_full.iss | 12 ++++--------
 bld/gen_port.iss |  5 +++--
 bld/gen_upd.iss  |  9 ++-------
 3 files changed, 9 insertions(+), 17 deletions(-)

diff --git a/bld/gen_full.iss b/bld/gen_full.iss
index 61fc0a3b..5cdf07ab 100644
--- a/bld/gen_full.iss
+++ b/bld/gen_full.iss
@@ -4,6 +4,7 @@
 #define MyAppName "TweetDuck"
 #define MyAppPublisher "chylex"
 #define MyAppURL "https://tweetduck.chylex.com"
+#define MyAppShortURL "https://td.chylex.com"
 #define MyAppExeName "TweetDuck.exe"
 
 #define MyAppVersion GetFileVersion("..\bin\x86\Release\TweetDuck.exe")
@@ -71,7 +72,7 @@ begin
   UpdatePath := ExpandConstant('{param:UPDATEPATH}')
   ForceRedistPrompt := ExpandConstant('{param:PROMPTREDIST}')
   
-  if (TDGetNetFrameworkVersion() < 379893) and (MsgBox('{#MyAppName} requires .NET Framework 4.5.2 or newer,'+#13+#10+'please download it from {#MyAppURL}'+#13+#10+#13+#10'Do you want to proceed with the setup anyway?', mbCriticalError, MB_YESNO or MB_DEFBUTTON2) = IDNO) then
+  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
     Result := False;
     Exit;
@@ -93,7 +94,7 @@ begin
     WizardForm.DirEdit.Text := UpdatePath;
   end;
   
-  if idpFilesCount <> 0 then
+  if (idpFilesCount <> 0) then
   begin
     idpDownloadAfter(wpReady);
   end;
@@ -105,16 +106,11 @@ begin
   Result := (PageID = wpSelectDir) and (UpdatePath <> '')
 end;
 
-{ Check for an old TweetDeck profile and show a warning before installation, and install VC++ if downloaded. }
+{ Install VC++ if downloaded. }
 procedure CurStepChanged(CurStep: TSetupStep);
 begin
   if CurStep = ssInstall then
   begin
-    if DirExists(ExpandConstant('{localappdata}\twitter\TweetDeck')) then
-    begin
-      MsgBox('Detected a profile from an old TweetDeck installation, you may uninstall the old client to free up some space.', mbInformation, MB_OK)
-    end;
-    
     TDInstallVCRedist();
   end;
 end;
diff --git a/bld/gen_port.iss b/bld/gen_port.iss
index e9e72228..d97f824d 100644
--- a/bld/gen_port.iss
+++ b/bld/gen_port.iss
@@ -4,6 +4,7 @@
 #define MyAppName "TweetDuck"
 #define MyAppPublisher "chylex"
 #define MyAppURL "https://tweetduck.chylex.com"
+#define MyAppShortURL "https://td.chylex.com"
 #define MyAppExeName "TweetDuck.exe"
 
 #define MyAppVersion GetFileVersion("..\bin\x86\Release\TweetDuck.exe")
@@ -57,7 +58,7 @@ begin
   UpdatePath := ExpandConstant('{param:UPDATEPATH}')
   ForceRedistPrompt := ExpandConstant('{param:PROMPTREDIST}')
   
-  if (TDGetNetFrameworkVersion() < 379893) and (MsgBox('{#MyAppName} requires .NET Framework 4.5.2 or newer,'+#13+#10+'please download it from {#MyAppURL}'+#13+#10+#13+#10'Do you want to proceed with the setup anyway?', mbCriticalError, MB_YESNO or MB_DEFBUTTON2) = IDNO) then
+  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
     Result := False;
     Exit;
@@ -79,7 +80,7 @@ begin
     WizardForm.DirEdit.Text := UpdatePath;
   end;
   
-  if idpFilesCount <> 0 then
+  if (idpFilesCount <> 0) then
   begin
     idpDownloadAfter(wpReady);
   end;
diff --git a/bld/gen_upd.iss b/bld/gen_upd.iss
index 0c332982..330cbe61 100644
--- a/bld/gen_upd.iss
+++ b/bld/gen_upd.iss
@@ -4,6 +4,7 @@
 #define MyAppName "TweetDuck"
 #define MyAppPublisher "chylex"
 #define MyAppURL "https://tweetduck.chylex.com"
+#define MyAppShortURL "https://td.chylex.com"
 #define MyAppExeName "TweetDuck.exe"
 
 #define MyAppID "8C25A716-7E11-4AAD-9992-8B5D0C78AE06"
@@ -148,13 +149,7 @@ begin
     idpAddFile('https://github.com/{#MyAppPublisher}/{#MyAppName}/releases/download/'+TDGetAppVersionClean()+'/'+TDGetFullDownloadFileName(), ExpandConstant('{tmp}\{#MyAppName}.Full.exe'));
   end;
   
-  if TDGetNetFrameworkVersion() >= 379893 then
-  begin
-    Result := True;
-    Exit;
-  end;
-  
-  if (MsgBox('{#MyAppName} requires .NET Framework 4.5.2 or newer,'+#13+#10+'please download it from {#MyAppURL}'+#13+#10+#13+#10'Do you want to proceed with the setup anyway?', mbCriticalError, MB_YESNO or MB_DEFBUTTON2) = IDNO) then
+  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
     Result := False;
     Exit;