OSDN Git Service

Installer: Remove unused functions. Recover broken 32bit ShellExtension installation
authorTakashi Sawanaka <sdottaka@users.sourceforge.net>
Mon, 20 May 2019 13:56:52 +0000 (22:56 +0900)
committerTakashi Sawanaka <sdottaka@users.sourceforge.net>
Mon, 20 May 2019 13:56:52 +0000 (22:56 +0900)
Installer/InnoSetup/WinMerge.iss
Installer/InnoSetup/WinMergeX64.iss

index 178fc0a..61a2298 100755 (executable)
@@ -749,233 +749,6 @@ Begin
   Result := 'WinMergeU.exe';\r
 End;\r
 \r
-Function FixVersion(strInput: string): string;\r
-{Returns a version with four segments A.B.C.D}\r
-Var\r
-  {Stores the number of periods found within the version string}\r
-  intPeriods: integer;\r
-\r
-  {Creates a counter}\r
-  i: integer;\r
-\r
-  {Generates the string to be returned to the user}\r
-  strVersion: string;\r
-Begin\r
-\r
-  {Creates a copy of the input string before we tear it apart}\r
-  strVersion := strInput;\r
-\r
-  {Until strInput is empty do..}\r
-  While Length(strInput) > 0 do\r
-    Begin\r
-      {if the first character of the input string is a period then}\r
-      If Copy(strInput, 1, 1) = '.' Then\r
-\r
-        {Incriment the number of periods found}\r
-        intPeriods := intPeriods + 1;\r
-\r
-      {Remove the first character from the Input string}\r
-      strInput := Copy(strINput, 2, length(strINput));\r
-    End;\r
-\r
-  {For every period shy of 3 do..}\r
-  For i := 1 to 3 - intperiods do\r
-\r
-    {Add a '.0' to the version string}\r
-    strVersion := strVersion + '.0';\r
-\r
-  {Returns the Version string with the correct number of segments}\r
-  Result := strVersion;\r
-\r
-End;\r
-\r
-Function RemoveLeadingZeros(strInput: string): string;\r
-{Removes the leading zeros if any from a numeric string}\r
-Begin\r
-\r
-  {While the first character of the string is a zero}\r
-  While Copy(strInput, 1, 1) = '0' Do\r
-    begin\r
-\r
-    {Removes one leading zero from the input string}\r
-      strInput := Copy(strInput, 2, Length(strINput));\r
-    end;\r
-\r
-  {Returns the formatted string}\r
-  Result := strInput;\r
-\r
-End;\r
-\r
-\r
-{Returns whether or not the version string detected is meets the version number requirement}\r
-Function VersionAtLeast(strVersion_Installed: string; intMajor: integer; intMinor: integer; intRevision: integer; intBuild: integer): boolean;\r
-Var\r
-\r
-  {Stores the Major of the Version installed (X.0.0.0)}\r
-  intMajor_Installed: Integer;\r
-\r
-  {Stores the Minor of the Version installed (1.X.0.0)}\r
-  intMinor_Installed: Integer;\r
-\r
-  {Stores the Revision of the Version installed (1.0.X.0)}\r
-  intRevision_Installed: Integer;\r
-\r
-  {Stores the Revision of the Version installed (1.0.0.X)}\r
-  intBuild_Installed: Integer;\r
-\r
-  {Stores the last valid character of a particular segment (Major, Minor, Revision) of the Version string}\r
-  intEnd_Pos: Integer;\r
-\r
-begin\r
-  {Debug\r
-  Msgbox('The version installed is ' + strVersion_Installed + ' and the required version is ' + IntToStr(intMajor) + '.' + IntToStr(intMinor) + '.' + IntToStr(intRevision) + '.' + IntToStr(intBuild), mbINformation, mb_OK)\r
-        }\r
-\r
-  {Makes sure the version string contains four numberic segments 5.2 ---> 5.2.0.0}\r
-  strVersion_Installed := FixVersion(strVersion_Installed);\r
-\r
-  {If the version number is empty then quit the function}\r
-  if strVersion_Installed = '' Then\r
-    begin\r
-      Result := False;\r
-\r
-      {Stops analyzing the version installed and returns that the version installed was inadequate}\r
-      exit;\r
-    end;\r
-\r
-  {Starts detecting the Major value of the Version Installed}\r
-\r
-  {Sets the end position equal to one character before the first period in the version number}\r
-  intEnd_Pos := Pos('.', strVersion_Installed) -1\r
-\r
-  {Sets the major version equal to all character before the first period }\r
-  intMajor_installed := StrToIntDef(RemoveLeadingZeros(Copy(strVersion_Installed, 1, intEnd_Pos)), 0);\r
-\r
-  {Debug\r
-  msgbox('The Major version installed is ' + IntToStr(intMajor_installed) + ' and the required Major is ' + IntToStr(intMajor) + '.', mbInformation, MB_OK)\r
-        }\r
-\r
-  {If the Major Version Installed is greater than the required value then...}\r
-  if intMajor_Installed > intMajor Then\r
-    begin\r
-      {Returns that the version number was adequate, since it actually exceeded the requirement}\r
-      Result := True;\r
-\r
-        {Debug\r
-        msgbox(IntToStr(intMajor_installed) + ' > ' +  IntToStr(intMajor), mbInformation, MB_OK)\r
-        }\r
-\r
-      {Stops analyzing the version number since we already know it met the requirement}\r
-      exit;\r
-    end;\r
-\r
-  {If the Major version installed is less than the requirement then...}\r
-  If intMajor_Installed < intMajor Then\r
-    begin\r
-      {Debug\r
-       msgbox(IntToStr(intMajor_installed) + ' < ' +  IntToStr(intMajor), mbInformation, MB_OK)\r
-       }\r
-\r
-      Result := False;\r
-\r
-      {Stops analyzing the version number since we already know it's inadequate and returns False (inadequate)}\r
-      exit;\r
-    end;\r
-\r
-\r
-  {Starts detecting the Minor version of the Version Installed}\r
-\r
-  {Modifies strVersion_Installed removing the first period and everything prior to it (Removes the Major Version)}\r
-  strVersion_Installed := Copy(strVersion_Installed, intEnd_Pos + 2, Length(strVersion_Installed));\r
-\r
-  {Sets the end position equal to one character before the first period in the version number}\r
-  intEnd_Pos := Pos('.', strVersion_Installed) -1\r
-\r
-  {Sets the Minor version equal to all character before the first period }\r
-       intMinor_installed := StrToIntDef(RemoveLeadingZeros(Copy(strVersion_Installed, 1, intEnd_Pos)), 0)\r
-\r
-       {Debug\r
-  msgbox('The Minor version installed is ' + IntToStr(intMinor_installed) + ' and the required Minor is ' + IntToStr(intMinor) + '.', mbInformation, MB_OK)\r
-        }\r
-\r
-       {If the Minor Version Installed is greater than the required value then...}\r
-       If intMinor_Installed > intMinor Then\r
-    begin\r
-      {Returns that the version number was adequate}\r
-      Result := True;\r
-\r
-      {Stops further analyzation of the version number}\r
-      exit\r
-    end;\r
-\r
-  {If the minor installed is less than what was required}\r
-  If intMinor_Installed < intMinor Then\r
-    Begin\r
-      Result := False;\r
-\r
-      {Returns that the version installed did not meet the required value and stops analyzing the version number}\r
-      exit;\r
-    end;\r
-\r
-\r
-  {Starts Detecting the Revision of the Version Installed}\r
-\r
-       {Modifies strVersion_Installed removing the first period and everything prior to it (Removes the Minor Version)}\r
-       strVersion_Installed := Copy(strVersion_Installed, intEnd_Pos + 2, Length(strVersion_Installed));\r
-\r
-       {Sets the last character of the Revision to last character before the first period}\r
-       intEnd_Pos := Pos('.', strVersion_Installed) -1\r
-\r
-       {Sets the Revision Installed equal to everything before the first period}\r
-       intRevision_Installed := strToIntDef(RemoveLeadingZeros(Copy(strVersion_Installed, 1, intEnd_Pos)), 0);\r
-\r
-       {Debug\r
-  msgbox('The Revision version installed is ' + IntToStr(intRevision_installed) + ' and the required Revision is ' + IntToStr(intRevision) + '.', mbInformation, MB_OK)\r
-        }\r
-\r
-       {If the Revision Installed is greater than the required value then...}\r
-  If intRevision_Installed > intRevision Then\r
-    begin\r
-      {Return that the version installed was adequate}\r
-      Result := True;\r
-\r
-      {Stops further analyzation of the version number}\r
-      exit\r
-    end;\r
-\r
-  {If the revision installed did not meet the requirement then...}\r
-  If intRevision_Installed < intRevision Then\r
-    begin\r
-      Result := False;\r
-\r
-    {Return that the version number failed to meet the requirement and stops further analyzation of the version number}\r
-      exit;\r
-    end;\r
-\r
-  {Start Detection the Build Installed}\r
-\r
-       {Modifies strVersion_Installed removing the first period and everything prior to it (Removes the Revision) leaving behind only the build number}\r
-       strVersion_Installed := Copy(strVersion_Installed, intEnd_Pos + 2, Length(strVersion_Installed));\r
-\r
-       {Set the build installed = to what's left of the strVersion_Installed text}\r
-       intBuild_installed := strToIntDef(RemoveLeadingZeros(strVersion_Installed), 0);\r
-\r
-       {Debug\r
-  msgbox('The Build version installed is ' + IntToStr(intBuild_installed) + ' and the required Build is ' + IntToStr(intBuild) + '.', mbInformation, MB_OK)\r
-        }\r
-\r
-       {If the build installed is greater than or equal to the requirement then...}\r
-       if intBuild_installed >= intBuild Then\r
-\r
-        {Report that the version installed was adequate}\r
-    Result := True\r
-  else\r
-\r
-    {Reports the inadequacy of the version installed and seases processing }\r
-    Result := False;\r
-end;\r
-\r
-\r
 {Determines whether or not TortoiseCVS is installed}\r
 Function TortoiseCVSInstalled(): boolean;\r
 Begin\r
@@ -1060,23 +833,6 @@ Begin
     Result := '0';\r
 End;\r
 \r
-{Replace one occurrence of OldStr in Str with NewStr}\r
-Function ReplaceSubString(Src: string; OldStr: string; NewStr: string) : string;\r
-Var\r
-    OldStrStartAt: Integer;\r
-\r
-Begin\r
-    OldStrStartAt := Pos(OldStr, Src);\r
-    if OldStrStartAt > 0 then\r
-    begin\r
-        {Remove old string}\r
-        Delete(Src, OldStrStartAt, Length(OldStr));\r
-        {Insert new string}\r
-        Insert(NewStr, Src, OldStrStartAt);\r
-    end;\r
-    Result := Src;\r
-End;\r
-\r
 {Returns WinMerge installed exeutable file name}\r
 Function WinMergeExeName(): string;\r
 Var\r
index 761406b..ba71f55 100644 (file)
@@ -406,7 +406,7 @@ Source: ..\..\Build\X64\MergeUnicodeRelease\WinMergeU.exe; DestDir: {app}; Flags
 Source: ..\..\Plugins\WinMerge32BitPluginProxy\Release\WinMerge32BitPluginProxy.exe; DestDir: {app}; Flags: promptifolder; Components: Core\r
 \r
 ; Shell extension\r
-Source: ..\..\Build\ShellExtension\ShellExtensionU.dll; DestDir: {app}; Flags: regserver uninsrestartdelete restartreplace promptifolder; MinVersion: 0, 4; Check: not IsWin64\r
+Source: ..\..\Build\ShellExtension\ShellExtensionU.dll; DestDir: {app}; Flags: regserver uninsrestartdelete restartreplace promptifolder 32bit; MinVersion: 0, 4; Components: ShellExtension32bit\r
 ; 64-bit version of ShellExtension\r
 Source: ..\..\Build\ShellExtension\ShellExtensionX64.dll; DestDir: {app}; Flags: regserver uninsrestartdelete restartreplace promptifolder 64bit; MinVersion: 0,5.01.2600; Check: IsWin64\r
 \r
@@ -732,233 +732,6 @@ Begin
   Result := 'WinMergeU.exe';\r
 End;\r
 \r
-Function FixVersion(strInput: string): string;\r
-{Returns a version with four segments A.B.C.D}\r
-Var\r
-  {Stores the number of periods found within the version string}\r
-  intPeriods: integer;\r
-\r
-  {Creates a counter}\r
-  i: integer;\r
-\r
-  {Generates the string to be returned to the user}\r
-  strVersion: string;\r
-Begin\r
-\r
-  {Creates a copy of the input string before we tear it apart}\r
-  strVersion := strInput;\r
-\r
-  {Until strInput is empty do..}\r
-  While Length(strInput) > 0 do\r
-    Begin\r
-      {if the first character of the input string is a period then}\r
-      If Copy(strInput, 1, 1) = '.' Then\r
-\r
-        {Incriment the number of periods found}\r
-        intPeriods := intPeriods + 1;\r
-\r
-      {Remove the first character from the Input string}\r
-      strInput := Copy(strINput, 2, length(strINput));\r
-    End;\r
-\r
-  {For every period shy of 3 do..}\r
-  For i := 1 to 3 - intperiods do\r
-\r
-    {Add a '.0' to the version string}\r
-    strVersion := strVersion + '.0';\r
-\r
-  {Returns the Version string with the correct number of segments}\r
-  Result := strVersion;\r
-\r
-End;\r
-\r
-Function RemoveLeadingZeros(strInput: string): string;\r
-{Removes the leading zeros if any from a numeric string}\r
-Begin\r
-\r
-  {While the first character of the string is a zero}\r
-  While Copy(strInput, 1, 1) = '0' Do\r
-    begin\r
-\r
-    {Removes one leading zero from the input string}\r
-      strInput := Copy(strInput, 2, Length(strINput));\r
-    end;\r
-\r
-  {Returns the formatted string}\r
-  Result := strInput;\r
-\r
-End;\r
-\r
-\r
-{Returns whether or not the version string detected is meets the version number requirement}\r
-Function VersionAtLeast(strVersion_Installed: string; intMajor: integer; intMinor: integer; intRevision: integer; intBuild: integer): boolean;\r
-Var\r
-\r
-  {Stores the Major of the Version installed (X.0.0.0)}\r
-  intMajor_Installed: Integer;\r
-\r
-  {Stores the Minor of the Version installed (1.X.0.0)}\r
-  intMinor_Installed: Integer;\r
-\r
-  {Stores the Revision of the Version installed (1.0.X.0)}\r
-  intRevision_Installed: Integer;\r
-\r
-  {Stores the Revision of the Version installed (1.0.0.X)}\r
-  intBuild_Installed: Integer;\r
-\r
-  {Stores the last valid character of a particular segment (Major, Minor, Revision) of the Version string}\r
-  intEnd_Pos: Integer;\r
-\r
-begin\r
-  {Debug\r
-  Msgbox('The version installed is ' + strVersion_Installed + ' and the required version is ' + IntToStr(intMajor) + '.' + IntToStr(intMinor) + '.' + IntToStr(intRevision) + '.' + IntToStr(intBuild), mbINformation, mb_OK)\r
-        }\r
-\r
-  {Makes sure the version string contains four numberic segments 5.2 ---> 5.2.0.0}\r
-  strVersion_Installed := FixVersion(strVersion_Installed);\r
-\r
-  {If the version number is empty then quit the function}\r
-  if strVersion_Installed = '' Then\r
-    begin\r
-      Result := False;\r
-\r
-      {Stops analyzing the version installed and returns that the version installed was inadequate}\r
-      exit;\r
-    end;\r
-\r
-  {Starts detecting the Major value of the Version Installed}\r
-\r
-  {Sets the end position equal to one character before the first period in the version number}\r
-  intEnd_Pos := Pos('.', strVersion_Installed) -1\r
-\r
-  {Sets the major version equal to all character before the first period }\r
-  intMajor_installed := StrToIntDef(RemoveLeadingZeros(Copy(strVersion_Installed, 1, intEnd_Pos)), 0);\r
-\r
-  {Debug\r
-  msgbox('The Major version installed is ' + IntToStr(intMajor_installed) + ' and the required Major is ' + IntToStr(intMajor) + '.', mbInformation, MB_OK)\r
-        }\r
-\r
-  {If the Major Version Installed is greater than the required value then...}\r
-  if intMajor_Installed > intMajor Then\r
-    begin\r
-      {Returns that the version number was adequate, since it actually exceeded the requirement}\r
-      Result := True;\r
-\r
-        {Debug\r
-        msgbox(IntToStr(intMajor_installed) + ' > ' +  IntToStr(intMajor), mbInformation, MB_OK)\r
-        }\r
-\r
-      {Stops analyzing the version number since we already know it met the requirement}\r
-      exit;\r
-    end;\r
-\r
-  {If the Major version installed is less than the requirement then...}\r
-  If intMajor_Installed < intMajor Then\r
-    begin\r
-      {Debug\r
-       msgbox(IntToStr(intMajor_installed) + ' < ' +  IntToStr(intMajor), mbInformation, MB_OK)\r
-       }\r
-\r
-      Result := False;\r
-\r
-      {Stops analyzing the version number since we already know it's inadequate and returns False (inadequate)}\r
-      exit;\r
-    end;\r
-\r
-\r
-  {Starts detecting the Minor version of the Version Installed}\r
-\r
-  {Modifies strVersion_Installed removing the first period and everything prior to it (Removes the Major Version)}\r
-  strVersion_Installed := Copy(strVersion_Installed, intEnd_Pos + 2, Length(strVersion_Installed));\r
-\r
-  {Sets the end position equal to one character before the first period in the version number}\r
-  intEnd_Pos := Pos('.', strVersion_Installed) -1\r
-\r
-  {Sets the Minor version equal to all character before the first period }\r
-       intMinor_installed := StrToIntDef(RemoveLeadingZeros(Copy(strVersion_Installed, 1, intEnd_Pos)), 0)\r
-\r
-       {Debug\r
-  msgbox('The Minor version installed is ' + IntToStr(intMinor_installed) + ' and the required Minor is ' + IntToStr(intMinor) + '.', mbInformation, MB_OK)\r
-        }\r
-\r
-       {If the Minor Version Installed is greater than the required value then...}\r
-       If intMinor_Installed > intMinor Then\r
-    begin\r
-      {Returns that the version number was adequate}\r
-      Result := True;\r
-\r
-      {Stops further analyzation of the version number}\r
-      exit\r
-    end;\r
-\r
-  {If the minor installed is less than what was required}\r
-  If intMinor_Installed < intMinor Then\r
-    Begin\r
-      Result := False;\r
-\r
-      {Returns that the version installed did not meet the required value and stops analyzing the version number}\r
-      exit;\r
-    end;\r
-\r
-\r
-  {Starts Detecting the Revision of the Version Installed}\r
-\r
-       {Modifies strVersion_Installed removing the first period and everything prior to it (Removes the Minor Version)}\r
-       strVersion_Installed := Copy(strVersion_Installed, intEnd_Pos + 2, Length(strVersion_Installed));\r
-\r
-       {Sets the last character of the Revision to last character before the first period}\r
-       intEnd_Pos := Pos('.', strVersion_Installed) -1\r
-\r
-       {Sets the Revision Installed equal to everything before the first period}\r
-       intRevision_Installed := strToIntDef(RemoveLeadingZeros(Copy(strVersion_Installed, 1, intEnd_Pos)), 0);\r
-\r
-       {Debug\r
-  msgbox('The Revision version installed is ' + IntToStr(intRevision_installed) + ' and the required Revision is ' + IntToStr(intRevision) + '.', mbInformation, MB_OK)\r
-        }\r
-\r
-       {If the Revision Installed is greater than the required value then...}\r
-  If intRevision_Installed > intRevision Then\r
-    begin\r
-      {Return that the version installed was adequate}\r
-      Result := True;\r
-\r
-      {Stops further analyzation of the version number}\r
-      exit\r
-    end;\r
-\r
-  {If the revision installed did not meet the requirement then...}\r
-  If intRevision_Installed < intRevision Then\r
-    begin\r
-      Result := False;\r
-\r
-    {Return that the version number failed to meet the requirement and stops further analyzation of the version number}\r
-      exit;\r
-    end;\r
-\r
-  {Start Detection the Build Installed}\r
-\r
-       {Modifies strVersion_Installed removing the first period and everything prior to it (Removes the Revision) leaving behind only the build number}\r
-       strVersion_Installed := Copy(strVersion_Installed, intEnd_Pos + 2, Length(strVersion_Installed));\r
-\r
-       {Set the build installed = to what's left of the strVersion_Installed text}\r
-       intBuild_installed := strToIntDef(RemoveLeadingZeros(strVersion_Installed), 0);\r
-\r
-       {Debug\r
-  msgbox('The Build version installed is ' + IntToStr(intBuild_installed) + ' and the required Build is ' + IntToStr(intBuild) + '.', mbInformation, MB_OK)\r
-        }\r
-\r
-       {If the build installed is greater than or equal to the requirement then...}\r
-       if intBuild_installed >= intBuild Then\r
-\r
-        {Report that the version installed was adequate}\r
-    Result := True\r
-  else\r
-\r
-    {Reports the inadequacy of the version installed and seases processing }\r
-    Result := False;\r
-end;\r
-\r
-\r
 {Determines whether or not TortoiseCVS is installed}\r
 Function TortoiseCVSInstalled(): boolean;\r
 Begin\r
@@ -1043,23 +816,6 @@ Begin
     Result := '0';\r
 End;\r
 \r
-{Replace one occurrence of OldStr in Str with NewStr}\r
-Function ReplaceSubString(Src: string; OldStr: string; NewStr: string) : string;\r
-Var\r
-    OldStrStartAt: Integer;\r
-\r
-Begin\r
-    OldStrStartAt := Pos(OldStr, Src);\r
-    if OldStrStartAt > 0 then\r
-    begin\r
-        {Remove old string}\r
-        Delete(Src, OldStrStartAt, Length(OldStr));\r
-        {Insert new string}\r
-        Insert(NewStr, Src, OldStrStartAt);\r
-    end;\r
-    Result := Src;\r
-End;\r
-\r
 {Returns WinMerge installed exeutable file name}\r
 Function WinMergeExeName(): string;\r
 Var\r