scp2/source/ooo/common_brand.scp                 |  108 --------------------
 solenv/bin/modules/installer.pm                  |    6 -
 solenv/bin/modules/installer/scriptitems.pm      |    3 
 solenv/bin/modules/installer/windows/inifile.pm  |  124 -----------------------
 solenv/bin/modules/installer/windows/property.pm |    6 -
 5 files changed, 1 insertion(+), 246 deletions(-)

New commits:
commit 007a0ddeb02188a207b40b9a4438a37aebd81b60
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Fri Jan 12 17:35:52 2024 +0100
Commit:     Stephan Bergmann <stephan.bergm...@allotropia.de>
CommitDate: Mon Jan 22 09:33:52 2024 +0100

    Remove (Windows-only) INIFILETABLE entries from setup.ini
    
    (See a31f334d36b5735ba6fc8d0f89e834a73bdcc561 "Windows MAR update issues 
with
    program/{setup,version}.ini" for why this cleanup is needed.)
    
    It is unclear to me why these entries would be needed in the setup.ini file.
    The *INSTALLLOCATION values are also stored in the Windows registry (see
    scp2/source/ooo/registryitem_ooo.scp).  FINDPRODUCT was once used as a
    GetMsiProperty, in code meanwhile removed in
    030124d836a3f8571e26c8ce6b5d752ca7ab2511 "remove CustomAction
    ExecutePostUninstallScript" (so I also removed the FINDPRODUCT property file
    line from solenv/bin/modules/installer/windows/property.pm, so FINDPRODUCT 
will
    no longer in the MSI Property table).  ALLUSERS is only used with some
    SetMsiPropertyW/UnsetMsiPropertyW/IsSetMsiPropertyW/GetMsiPropertySetW code 
in
    setup_native/source/win32/customactions/, but that should be unrelated to 
the
    setup.ini file.
    
    Removing the ProfileItems from scp2/source/ooo/common_brand.scp removed the 
only
    uses of the INIFILETABLE style, so also remove the corresponding code from
    solenv/bin/modules/installer.pm and the complete related
    solenv/bin/modules/installer/windows/inifile.pm.  Fingers crossed.
    A#      modified:   scp2/source/ooo/common_brand.scp
    
    Change-Id: If2aa72f0da50bc72f8c873df713340a142eed5e6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161981
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de>

diff --git a/scp2/source/ooo/common_brand.scp b/scp2/source/ooo/common_brand.scp
index d5eecd354e0a..5da3647c2ced 100644
--- a/scp2/source/ooo/common_brand.scp
+++ b/scp2/source/ooo/common_brand.scp
@@ -777,34 +777,6 @@ ProfileItem gid_Brand_Profileitem_Redirect_Ure_Bootstrap
 End
 #endif
 
-#ifdef WNT
-ProfileItem gid_Brand_Profileitem_Setup_Alluserset
-    ProfileID = gid_Brand_Profile_Setup_Ini;
-    ModuleID = gid_Module_Root_Brand;
-    Section = "Bootstrap";
-    Order = 4;
-    Key = "ALLUSERS";
-    Value = "[ALLUSERS]";
-    Inifiletablekey = "AllUsersSet";
-    Inifiletableaction = "1";
-    Styles = (INIFILETABLE);
-End
-#endif
-
-#ifdef WNT
-ProfileItem gid_Brand_Profileitem_Setup_Findproduct
-    ProfileID = gid_Brand_Profile_Setup_Ini;
-    ModuleID = gid_Module_Root_Brand;
-    Section = "Bootstrap";
-    Order = 5;
-    Key = "FINDPRODUCT";
-    Value = "[FINDPRODUCT]";
-    Inifiletablekey = "FindProductSet";
-    Inifiletableaction = "1";
-    Styles = (INIFILETABLE);
-End
-#endif
-
 ProfileItem gid_Brand_Profileitem_Setup_Buildid
     ProfileID = gid_Brand_Profile_Setup_Ini;
     ModuleID = gid_Module_Root_Brand;
@@ -813,59 +785,3 @@ ProfileItem gid_Brand_Profileitem_Setup_Buildid
     Key = "buildid";
     Value = "<buildid>";
 End
-
-#ifdef WNT
-ProfileItem gid_Brand_Profileitem_Setup_Ureinstall
-    ProfileID = gid_Brand_Profile_Setup_Ini;
-    ModuleID = gid_Module_Root_Brand;
-    Section = "Bootstrap";
-    Order = 4;
-    Key = "UREINSTALLLOCATION";
-    Value = "[INSTALLLOCATION]URE\";
-    Inifiletablekey = "UreInstallLocation";
-    Inifiletableaction = "1";
-    Styles = (INIFILETABLE);
-End
-#endif
-
-#ifdef WNT
-ProfileItem gid_Brand_Profileitem_Setup_Basisinstall
-    ProfileID = gid_Brand_Profile_Setup_Ini;
-    ModuleID = gid_Module_Root_Brand;
-    Section = "Bootstrap";
-    Order = 4;
-    Key = "BASISINSTALLLOCATION";
-    Value = "[INSTALLLOCATION]";
-    Inifiletablekey = "BasisInstallLocation";
-    Inifiletableaction = "1";
-    Styles = (INIFILETABLE);
-End
-#endif
-
-#ifdef WNT
-ProfileItem gid_Brand_Profileitem_Setup_Officeinstall
-    ProfileID = gid_Brand_Profile_Setup_Ini;
-    ModuleID = gid_Module_Root_Brand;
-    Section = "Bootstrap";
-    Order = 4;
-    Key = "OFFICEINSTALLLOCATION";
-    Value = "[INSTALLLOCATION]";
-    Inifiletablekey = "OfficeInstallLocation";
-    Inifiletableaction = "1";
-    Styles = (INIFILETABLE);
-End
-#endif
-
-#ifdef WNT
-ProfileItem gid_Brand_Profileitem_Setup_Install
-    ProfileID = gid_Brand_Profile_Setup_Ini;
-    ModuleID = gid_Module_Root_Brand;
-    Section = "Bootstrap";
-    Order = 4;
-    Key = "INSTALLLOCATION";
-    Value = "[INSTALLLOCATION]";
-    Inifiletablekey = "InstallLocation";
-    Inifiletableaction = "1";
-    Styles = (INIFILETABLE);
-End
-#endif
diff --git a/solenv/bin/modules/installer.pm b/solenv/bin/modules/installer.pm
index 33c0c5b6e459..8c5c275adb91 100644
--- a/solenv/bin/modules/installer.pm
+++ b/solenv/bin/modules/installer.pm
@@ -61,7 +61,6 @@ use installer::windows::file;
 use installer::windows::font;
 use installer::windows::icon;
 use installer::windows::idtglobal;
-use installer::windows::inifile;
 use installer::windows::media;
 use installer::windows::mergemodule;
 use installer::windows::msiglobal;
@@ -1320,9 +1319,6 @@ sub run {
             @installer::globals::binarytableonlyfiles = ();
             $filesinproductlanguageresolvedarrayref = 
installer::worker::remove_all_items_with_special_flag($filesinproductlanguageresolvedarrayref
 ,"BINARYTABLE_ONLY");
 
-            # Collecting all profileitems with flag "INIFILETABLE" for table 
"IniFile"
-            my $inifiletableentries = 
installer::worker::collect_all_items_with_special_flag($profileitemsinproductlanguageresolvedarrayref
 ,"INIFILETABLE");
-
             # Creating the important dynamic idt files
             
installer::windows::msiglobal::set_msiproductversion($allvariableshashref);
 
@@ -1361,8 +1357,6 @@ sub run {
 
             
installer::windows::shortcut::create_shortcut_table($filesinproductlanguageresolvedarrayref,
 $linksinproductlanguageresolvedarrayref, 
$folderinproductlanguageresolvedarrayref, 
$folderitemsinproductlanguageresolvedarrayref, $directoriesforepmarrayref, 
$newidtdir, \@setuplanguagesarray, $includepatharrayref, \@iconfilecollector);
 
-            
installer::windows::inifile::create_inifile_table($inifiletableentries, 
$filesinproductlanguageresolvedarrayref, $newidtdir);
-
             installer::windows::icon::create_icon_table(\@iconfilecollector, 
$newidtdir);    # creating the icon table with all iconfiles used as shortcuts 
(FolderItems)
 
             
installer::windows::createfolder::create_createfolder_table($directoriesforepmarrayref,
 $filesinproductlanguageresolvedarrayref, $newidtdir, $allvariableshashref);
diff --git a/solenv/bin/modules/installer/windows/inifile.pm 
b/solenv/bin/modules/installer/windows/inifile.pm
deleted file mode 100644
index a00e4758ef2f..000000000000
--- a/solenv/bin/modules/installer/windows/inifile.pm
+++ /dev/null
@@ -1,124 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-#   Licensed to the Apache Software Foundation (ASF) under one or more
-#   contributor license agreements. See the NOTICE file distributed
-#   with this work for additional information regarding copyright
-#   ownership. The ASF licenses this file to you under the Apache
-#   License, Version 2.0 (the "License"); you may not use this file
-#   except in compliance with the License. You may obtain a copy of
-#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-
-package installer::windows::inifile;
-
-use strict;
-use warnings;
-
-use installer::exiter;
-use installer::files;
-use installer::globals;
-use installer::windows::idtglobal;
-
-####################################################
-# Setting the profile for a special profileitem
-####################################################
-
-sub get_profile_for_profileitem
-{
-    my ($profileid, $filesref) = @_;
-
-    my ($profile) = grep {$_->{gid} eq $profileid} @{$filesref};
-    if (! defined $profile) {
-        installer::exiter::exit_program("ERROR: Could not find file $profileid 
in list of files!", "get_profile_for_profileitem");
-    }
-
-    return $profile;
-}
-
-####################################################
-# Checking whether profile is part of product
-####################################################
-
-sub file_is_part_of_product
-{
-    my ($profilegid, $filesref) = @_;
-
-    my $part_of_product = 0;
-
-    for ( my $i = 0; $i <= $#{$filesref}; $i++ )
-    {
-        my $onefile = ${$filesref}[$i];
-        my $filegid = $onefile->{'gid'};
-
-        if ( $filegid eq $profilegid )
-        {
-            $part_of_product = 1;
-            last;
-        }
-    }
-
-    return $part_of_product;
-}
-
-###########################################################################################################
-# Creating the file IniFile.idt dynamically
-# Content:
-# IniFile      FileName        DirProperty     Section Key     Value   Action  
Component_
-###########################################################################################################
-
-sub create_inifile_table
-{
-    my ($inifiletableentries, $filesref, $basedir) = @_;
-
-    my @inifiletable = ();
-
-    installer::windows::idtglobal::write_idt_header(\@inifiletable, "inifile");
-
-    for ( my $i = 0; $i <= $#{$inifiletableentries}; $i++ )
-    {
-        my $profileitem = ${$inifiletableentries}[$i];
-
-        my $profileid = $profileitem->{'ProfileID'};
-
-        # Is this profile part of the product? This is not sure, for example 
in patch process.
-        # If the profile is not part of the product, this ProfileItem must be 
ignored.
-
-        if ( ! file_is_part_of_product($profileid, $filesref) ) { next; }
-
-        my $profile = get_profile_for_profileitem($profileid, $filesref);
-
-        my %inifile = ();
-
-        $inifile{'IniFile'} = $profileitem->{'Inifiletablekey'};
-        $inifile{'FileName'} = $profile->{'Name'};
-        $inifile{'DirProperty'} = $profile->{'uniquedirname'};
-        $inifile{'Section'} = $profileitem->{'Section'};
-        $inifile{'Key'} = $profileitem->{'Key'};
-        $inifile{'Value'} = $profileitem->{'Value'};
-        $inifile{'Action'} = $profileitem->{'Inifiletableaction'};
-        $inifile{'Component_'} = $profile->{'componentname'};
-
-        my $oneline = $inifile{'IniFile'} . "  " . $inifile{'FileName'} . "    
" . $inifile{'DirProperty'} . " "
-                 . $inifile{'Section'} . "     " . $inifile{'Key'} . " " . 
$inifile{'Value'} . "       "
-                 . $inifile{'Action'} . "      " . $inifile{'Component_'} . "
";
-
-        push(@inifiletable, $oneline);
-    }
-
-    # Saving the file
-
-    my $inifiletablename = $basedir . $installer::globals::separator . 
"IniFile.idt";
-    installer::files::save_file($inifiletablename ,\@inifiletable);
-    my $infoline = "Created idt file: $inifiletablename
";
-    push(@installer::globals::logfileinfo, $infoline);
-
-}
-
-1;
diff --git a/solenv/bin/modules/installer/windows/property.pm 
b/solenv/bin/modules/installer/windows/property.pm
index 701086af3a66..fe8e94d44aae 100644
--- a/solenv/bin/modules/installer/windows/property.pm
+++ b/solenv/bin/modules/installer/windows/property.pm
@@ -212,12 +212,6 @@ sub set_important_properties
         push(@{$propertyfile}, $onepropertyline);
     }
 
-    if (( $allvariables->{'PRODUCTNAME'} ) && ( 
$allvariables->{'PRODUCTVERSION'} ) && ( $allvariables->{'REGISTRYLAYERNAME'} ))
-    {
-        my $onepropertyline = "FINDPRODUCT" . "        " . 
"Software\LibreOffice" . "\" . $allvariables->{'REGISTRYLAYERNAME'} . "\" . 
$allvariables->{'PRODUCTNAME'} . "\" . $allvariables->{'PRODUCTVERSION'} . "
";
-        push(@{$propertyfile}, $onepropertyline);
-    }
-
     if ( $allvariables->{'PRODUCTMAJOR'} )
     {
         my $onepropertyline = "PRODUCTMAJOR" . "       " . 
$allvariables->{'PRODUCTMAJOR'} . "
";
commit 8fc46ffb0e7ecdd6975516ecc722d477fb0b29ad
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Fri Jan 12 16:55:18 2024 +0100
Commit:     Stephan Bergmann <stephan.bergm...@allotropia.de>
CommitDate: Mon Jan 22 09:33:42 2024 +0100

    Remove (Windows-only) UpgradeCode from setup.ini and version.ini
    
    (See a31f334d36b5735ba6fc8d0f89e834a73bdcc561 "Windows MAR update issues 
with
    program/{setup,version}.ini" for why this cleanup is needed.)
    
    I couldn't find any traces of any code actually reading that entry from
    ini-files.  (There is some code in
    setup_native/source/win32/customactions/shellextensions/ calling 
GetMsiPropertyW
    with an L"UpgradeCode" argument, but that's something different.)
    
    Change-Id: I8ed79e7f7911635c52e1c41f54014b1445c561de
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161980
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de>

diff --git a/scp2/source/ooo/common_brand.scp b/scp2/source/ooo/common_brand.scp
index 303bf24470dd..d5eecd354e0a 100644
--- a/scp2/source/ooo/common_brand.scp
+++ b/scp2/source/ooo/common_brand.scp
@@ -498,19 +498,6 @@ ProfileItem gid_Brand_Profileitem_Version_Buildid
     Value = "<buildid>";
 End
 
-#ifdef WNT
-
-ProfileItem gid_Brand_Profileitem_Version_Upgradecode
-    ProfileID = gid_Brand_Profile_Version_Ini;
-    ModuleID = gid_Module_Root_Brand;
-    Section = "Version";
-    Order = 9;
-    Key = "UpgradeCode";
-    Value = "<upgradecode>";
-End
-
-#endif
-
 ProfileItem gid_Brand_Profileitem_Version_Alllanguages
     ProfileID = gid_Brand_Profile_Version_Ini;
     ModuleID = gid_Module_Root_Brand;
@@ -818,17 +805,6 @@ ProfileItem gid_Brand_Profileitem_Setup_Findproduct
 End
 #endif
 
-#ifdef WNT
-ProfileItem gid_Brand_Profileitem_Setup_Upgradecode
-    ProfileID = gid_Brand_Profile_Setup_Ini;
-    ModuleID = gid_Module_Root_Brand;
-    Section = "Bootstrap";
-    Order = 7;
-    Key = "UpgradeCode";
-    Value = "<upgradecode>";
-End
-#endif
-
 ProfileItem gid_Brand_Profileitem_Setup_Buildid
     ProfileID = gid_Brand_Profile_Setup_Ini;
     ModuleID = gid_Module_Root_Brand;
diff --git a/solenv/bin/modules/installer/scriptitems.pm 
b/solenv/bin/modules/installer/scriptitems.pm
index 040bc068889f..a7cb1ab317fe 100644
--- a/solenv/bin/modules/installer/scriptitems.pm
+++ b/solenv/bin/modules/installer/scriptitems.pm
@@ -625,7 +625,7 @@ sub changing_name_of_language_dependent_keys
 
 
################################################################################
 # Replacement of setup variables in ConfigurationItems and ProfileItems
-# <productkey>, <buildid>, <sequence_languages>, <upgradecode>, <productupdate>
+# <productkey>, <buildid>, <sequence_languages>, <productupdate>
 
################################################################################
 
 sub replace_setup_variables
@@ -665,7 +665,6 @@ sub replace_setup_variables
         $value =~ s/\<buildid\>/$buildidstring/;
         $value =~ s/\<sequence_languages\>/$languagesstring/;
         $value =~ s/\<productkey\>/$productkey/;
-        $value =~ s/\<upgradecode\>/$installer::globals::upgradecode/;
         $value =~ s/\<alllanguages\>/$languagesstring/;
         $value =~ s/\<sourceid\>/$installer::globals::build/;
         $value =~ s/\<updateid\>/$updateid/;

Reply via email to