summaryrefslogtreecommitdiff
path: root/Master/tlpkg/dev/dev.split-desktop-integration.patch
blob: 4c308574422c132676e3a511d62d163136ec1c67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
Index: install-tl
===================================================================
--- install-tl	(revision 19656)
+++ install-tl	(working copy)
@@ -861,15 +861,13 @@
 sub do_tlpdb_postactions {
   info ("running package specific postactions\n");
   # Run the post installation code in the postaction tlpsrc entries
-  # For now the option_desktop_integrations maps to both desktop
-  # and menu entries, but we can split that later
   my $usedtlpdb = $vars{'from_dvd'} ? $tlpdb : $localtlpdb;
   foreach my $package ($usedtlpdb->list_packages) {
     &TeXLive::TLUtils::do_postaction("install",
                                      $usedtlpdb->get_package($package),
                                      $vars{'option_file_assocs'},
                                      $vars{'option_desktop_integration'},
-                                     $vars{'option_desktop_integration'},
+                                     $vars{'option_menu_integration'},
                                      $vars{'option_post_code'});
   }
   info ("finished with package specific postactions\n");
@@ -1313,6 +1311,8 @@
                            && ($tlpdb->option("paper") eq "letter" ? 1 : 0);
   $vars{'option_desktop_integration'} = $tlpdb->option("desktop_integration");
   $vars{'option_desktop_integration'} = 1 if win32();
+  $vars{'option_menu_integration'} = $tlpdb->option("menu_integration");
+  $vars{'option_menu_integration'} = 1 if win32();
   $vars{'option_path'} = $tlpdb->option("path");
   $vars{'option_path'} = 0 if !defined($vars{'option_path'});
   $vars{'option_path'} = 1 if win32();
@@ -1496,6 +1496,7 @@
   $vars{'option_path'}                &&= !$vars{'portable'};
   $vars{'option_file_assocs'}         &&= !$vars{'portable'};
   $vars{'option_desktop_integration'} &&= !$vars{'portable'};
+  $vars{'option_menu_integration'}    &&= !$vars{'portable'};
 }
 
 sub prepare_installation {
@@ -1543,6 +1544,7 @@
   $localtlpdb->option ("backupdir", $vars{'option_backupdir'});
   $localtlpdb->option ("create_formats", $vars{'option_fmt'} ? "1" : "0");
   $localtlpdb->option ("desktop_integration", $vars{'option_desktop_integration'} ? "1" : "0");
+  $localtlpdb->option ("menu_integration", $vars{'option_menu_integration'} ? "1" : "0");
   $localtlpdb->option ("file_assocs", $vars{'option_file_assocs'});
   $localtlpdb->option ("post_code", $vars{'option_post_code'} ? "1" : "0");
   $localtlpdb->option ("sys_bin", $vars{'option_sys_bin'});
@@ -1635,6 +1637,7 @@
     $previoustlpdb->option_pkg("00texlive.installation",
                                "create_formats");
   $vars{'option_desktop_integration'} = 1 if win32();
+  $vars{'option_menu_integration'} = 1 if win32();
   $vars{'option_path'} =
     $previoustlpdb->option_pkg("00texlive.installation",
                                "path");
Index: tlpkg/TeXLive/TLConfig.pm
===================================================================
--- tlpkg/TeXLive/TLConfig.pm	(revision 19656)
+++ tlpkg/TeXLive/TLConfig.pm	(working copy)
@@ -140,7 +140,10 @@
       "Create formats on installation" ],
   "desktop_integration" =>
     [ "b", 1, "desktop_integration",
-      "Create shortcuts (menu and desktop) in postinst" ],
+      "Create shortcuts on the desktop in postinst" ],
+  "menu_integration" =>
+    [ "b", 1, "menu_integration",
+      "Create shortcuts in the Start menu in postinst" ],
   "file_assocs" =>
     [ "n:0..2", 1, "fileassocs",
       "Change file associations in postinst" ],
Index: tlpkg/TeXLive/TLMedia.pm
===================================================================
--- tlpkg/TeXLive/TLMedia.pm	(revision 19656)
+++ tlpkg/TeXLive/TLMedia.pm	(working copy)
@@ -272,12 +272,10 @@
       if (win32() && admin() && !$totlpdb->option("w32_multi_user")) {
         non_admin();
       }
-      # for now desktop_integration maps to both installation
-      # of desktop shortcuts and menu items, but we can split them later
       &TeXLive::TLUtils::do_postaction("install", $tlpobj,
         $totlpdb->option("file_assocs"),
         $totlpdb->option("desktop_integration"),
-        $totlpdb->option("desktop_integration"),
+        $totlpdb->option("menu_integration"),
         $totlpdb->option("post_code"));
     }
   }
@@ -492,8 +490,8 @@
     if (defined($opts{'nopostinstall'}) && $opts{'nopostinstall'}) {
       &TeXLive::TLUtils::do_postaction("remove", $tlp,
         0, # option_file_assocs,
-        0, # option_desktop_integration, menu part
-        0, # option_desktop_integration, desktop part
+        0, # option_desktop_integration
+        0, # option_menu_integration
         $localtlpdb->option("post_code"));
     }
     # 
@@ -523,12 +521,11 @@
     # Run the post installation code in the postaction tlpsrc entries
     # the postaction code part cannot be evaluated now since the
     # files are already removed.
-    # Again, desktop integration maps to desktop and menu links
     if (!$nopostinstall) {
       &TeXLive::TLUtils::do_postaction("remove", $tlp,
         $localtlpdb->option("file_assocs"),
         $localtlpdb->option("desktop_integration"),
-        $localtlpdb->option("desktop_integration"),
+        $localtlpdb->option("menu_integration"),
         0);
     }
   }
Index: tlpkg/installer/install-menu-wizard.pl
===================================================================
--- tlpkg/installer/install-menu-wizard.pl	(revision 19656)
+++ tlpkg/installer/install-menu-wizard.pl	(working copy)
@@ -16,7 +16,7 @@
 # for unix and windows. On W32 with admin privileges both @w32 list options
 # are shown
 my @unix_opts = qw/letter/;
-my @w32_opts = qw/letter desktop_integration/;
+my @w32_opts = qw/letter desktop_integration menu_integration/;
 my @w32_admin_opts = qw/w32_multi_user/;
 
 my @opts_list = ();
@@ -329,7 +329,8 @@
 
 my %opts_to_str = (
   "letter" => "Default paper size",
-  "desktop_integration" => "Add shortcuts to menu and desktop",
+  "desktop_integration" => "Add shortcuts on the desktop",
+  "menu_integration" => "Add shortcuts in the Start menu",
   "file_assocs" => "Change file associations",
   "path" => "Adjust PATH setting in registry",
   "w32_multi_user" => "Installation for all users",
@@ -357,9 +358,13 @@
 #                    -variable => \$vars{"option_letter"});
 #
 #  $opt_cb{"desktop_integration"} = $fmain->Checkbutton(
-#                    -text => __("Add shortcuts to menu and desktop"),
+#                    -text => __("Add shortcuts on the desktop"),
 ##                    -variable => \$vars{"option_desktop_integration"});
 #
+#  $opt_cb{"menu_integration"} = $fmain->Checkbutton(
+#                    -text => __("Add shortcuts in the Start menu"),
+##                    -variable => \$vars{"option_desktop_integration"});
+#
 #  $opt_cb{"file_assocs"} = $fmain->Checkbutton(
 #                    -text => __('Change file associations'), 
 ##                    -variable => \$vars{"option_file_assocs"});
Index: tlpkg/installer/install-menu-perltk.pl
===================================================================
--- tlpkg/installer/install-menu-perltk.pl	(revision 19656)
+++ tlpkg/installer/install-menu-perltk.pl	(working copy)
@@ -78,6 +78,7 @@
 my $fmtyesno = ( $vars{'option_fmt'} ? __("Yes") : __("No") );
 my $srcyesno = ( $vars{'option_src'} ? __("Yes") : __("No") );
 my $deskintyesno = ( $vars{'option_desktop_integration'} ? __("Yes") : __("No") );
+my $menuintyesno = ( $vars{'option_menu_integration'} ? __("Yes") : __("No") );
 my $pathadjyesno = ( $vars{'option_path'} ? __("Yes") : __("No") );
 my $fileassocyesno = $::fileassocdesc[$vars{'option_file_assocs'}];
 my $editoryesno = ( $vars{'collection-texworks'} ? __("Yes") : __("No") );
@@ -294,11 +295,17 @@
 
   if ($::opt_all_options || win32()) {
     $row++;
-    $fr->Label(-text => __('Add shortcuts to menu and desktop'), -anchor => 'w')->grid(-row => $row, -column => 1, -sticky => 'w');
+    $fr->Label(-text => __('Add shortcuts on the desktop'), -anchor => 'w')->grid(-row => $row, -column => 1, -sticky => 'w');
     $fr->Label(-anchor => 'w', -textvariable => \$deskintyesno)->grid(-row => $row, -column => 2, -padx => "2m");
     $fr->Button(-text => __("Toggle"), -command => sub { toggle_and_set_opt_variable(\$vars{'option_desktop_integration'}, \$deskintyesno); })->grid(-row => $row, -column => 3, -sticky => "ew", -padx => "2m");
 
     $row++;
+    $fr->Label(-text => __('Add shortcuts in Start menu'), -anchor => 'w')->grid(-row => $row, -column => 1, -sticky => 'w');
+    $fr->Label(-anchor => 'w', -textvariable => \$menuintyesno)->grid(-row => $row, -column => 2, -padx => "2m");
+    $fr->Button(-text => __("Toggle"), -command => sub { toggle_and_set_opt_variable(\$vars{'option_menu_integration'}, \$menuintyesno); })->grid(-row => $row, -column => 3, -sticky => "ew", -padx => "2m");
+
+    $row++;
+    $row++;
     $fr->Label(-text => __('Change file associations'), -anchor => 'w')->grid(-row => $row, -column => 1, -sticky => 'w');
     $fr->Label(-anchor => 'w', -textvariable => \$fileassocyesno)->grid(-row => $row, -column => 2, -padx => "2m");
     $fr->Button(-text => __("Change"), -command => sub { menu_edit_file_assocs(); })->grid(-row => $row, -column => 3, -sticky => "ew", -padx => "2m");
Index: tlpkg/installer/install-menu-text.pl
===================================================================
--- tlpkg/installer/install-menu-text.pl	(revision 19656)
+++ tlpkg/installer/install-menu-text.pl	(working copy)
@@ -711,6 +711,7 @@
   my $b_fmt=button($vars{'option_fmt'});
   my $b_letter=button($vars{'option_letter'});
   my $b_deskint=button($vars{'option_desktop_integration'});
+  my $b_menuint=button($vars{'option_menu_integration'});
   my $b_admin=button($vars{'option_w32_multi_user'});
   my $b_addoneditor=button($vars{'collection-texworks'});
   my $b_restricted=button($vars{'option_write18_restricted'});
@@ -760,7 +761,8 @@
 ;
     }
     if (win32() || $::opt_all_options) {
-      print " <M> install menu items, shortcuts, etc:       $b_deskint\n";
+      print " <L> install desktop shortcuts:                $b_deskint\n";
+      print " <M> install menu items:                       $b_menuint\n";
       print " <N> update file associations:                 [$::fileassocdesc[$vars{'option_file_assocs'}]]\n";
       if ($::opt_all_options || TeXLive::TLWinGoo::admin()) {
         # if we are admin we allow normal user installation, too
@@ -812,10 +814,14 @@
     }
   }
   if (win32() || $::opt_all_options) {
-    if ("\u$answer" eq 'M') {
+    if ("\u$answer" eq 'L') {
       toggle 'option_desktop_integration';
       return $command{'self'};
 
+    } elsif ("\u$answer" eq 'M') {
+      toggle 'option_menu_integration';
+      return $command{'self'};
+
     } elsif ("\u$answer" eq 'N') {
       print "New value for file_assocs:\n";
       print "  0 -- don't tweak the file associations\n";
@@ -898,6 +904,7 @@
   my $b_fmt=button($vars{'option_fmt'});
   my $b_letter=button($vars{'option_letter'});
   my $b_deskint=button($vars{'option_desktop_integration'});
+  my $b_menuint=button($vars{'option_menu_integration'});
   my $b_admin=button($vars{'option_w32_multi_user'});
   my $b_addoneditor=button($vars{'collection-texworks'});
   my $b_restricted=button($vars{'option_write18_restricted'});
@@ -1014,7 +1021,8 @@
     }
     if (win32()) {
       print "   $b_path adjust search path\n";
-      print "   $b_deskint add menu items, shortcuts, etc.\n";
+      print "   $b_deskint add desktop shortcuts\n";
+      print "   $b_menuint add menu items\n";
       print "   [$vars{'option_file_assocs'}] update file associations\n";
       if (admin()) {
         print "   $b_admin make installation available to all users\n";
Index: tlpkg/installer/installer-options.txt
===================================================================
--- tlpkg/installer/installer-options.txt	(revision 19656)
+++ tlpkg/installer/installer-options.txt	(working copy)
@@ -36,12 +36,20 @@
 
 option_desktop_integration    1             w32     w32       w32
    option("desktop_integration")
-   shortcuts etc
+   shortcuts on the desktop
    currently effects w32 only
    install-tl: sub do_tlpdb_postactions
    TLMedia: remove_package, install_package
 
+option_menu_integration       1             w32     w32       w32
+   option("menu_integration")
+   shortcuts in the menu
+   currently effects w32 only
+   install-tl: sub do_tlpdb_postactions
+   TLMedia: remove_package, install_package
+
 option_post_code              1
+option_post_code              1
    option("post_code")
    postaction code
    install-tl: sub do_tlpdb_postactions
Index: texmf/scripts/texlive/tlmgr.pl
===================================================================
--- texmf/scripts/texlive/tlmgr.pl	(revision 19656)
+++ texmf/scripts/texlive/tlmgr.pl	(working copy)
@@ -2886,6 +2886,7 @@
     for my $o (keys %{$localtlpdb->options}) {
       # ignore some things which are win32 specific
       next if ($o eq "desktop_integration" && !win32());
+      next if ($o eq "menu_integration" && !win32());
       next if ($o eq "file_assocs" && !win32());
       next if ($o eq "w32_multi_user" && !win32());
       if (win32()) {
@@ -3999,9 +4000,10 @@
     @todo = @ARGV;
     @todo = $localtlpdb->expand_dependencies("-only-arch", $localtlpdb, @todo);
   }
-  if ($type =~ m/^shortcut$/i) {
+  if ($type =~ m/^(shortcut|desktop|menu)$/i) {
+    my $st = lc($1);
     if (!win32()) {
-      tlwarn("action postaction shortcut only works on windows.\n");
+      tlwarn("action postaction $st only works on windows.\n");
       return;
     }
     for my $p (@todo) {
@@ -4010,7 +4012,18 @@
         tlwarn("$p is not installed, ignoring it.\n");
       } else {
         # run all shortcut actions, desktop and menu integration
-        TeXLive::TLUtils::do_postaction($how, $tlp, 0, 1, 1, 0);
+        my @op = (1, 1);
+        if ($st eq "shortcut") {
+          @op = (1, 1);
+        } elsif ($st eq "menu") {
+          @op = (1, 0);
+        } elsif ($st eq "desktop") {
+          @op = (0, 1);
+        } else {
+          tlwarn("very strange, that should not happen: postaction type shortcut = ..$st..\n");
+          @op = (0, 0);
+        }
+        TeXLive::TLUtils::do_postaction($how, $tlp, 0, @op, 0);
       }
     }
   } elsif ($type =~ m/^fileassoc$/i) {
@@ -5418,12 +5431,15 @@
 
 
 =head2 postaction [--w32mode=user|admin] [--fileassocmode=1|2] [--all]
-    [install|remove] [shortcut|fileassoc|script] [I<pkg>]...
+    [install|remove] [shortcut|menu|desktop|fileassoc|script] [I<pkg>]...
 
 Carry out the postaction C<shortcut>, C<fileassoc>, or C<script> given
 as the second required argument in install or remove mode (which is the
 first required argument), for either the packages given on the command
-line, or for all if C<--all> is given.
+line, or for all if C<--all> is given. Here C<shortcut> runs both the
+desktop and menu shortcut code, while C<menu> only installs/removes
+the menu entries, and C<desktop> only installs/removes the desktop
+shortcuts.
 
 The option C<--w32mode> is C<user> all actions will only carried out in
 the user accessible parts of the registry/filesystem, while the C<admin>
Index: texmf/scripts/texlive/tlmgrgui.pl
===================================================================
--- texmf/scripts/texlive/tlmgrgui.pl	(revision 19656)
+++ texmf/scripts/texlive/tlmgrgui.pl	(working copy)
@@ -1098,8 +1098,16 @@
 
     if (win32()) {
       push @config_set_l,
-        $back_config_set->Label(-text => __("Create shortcuts in menu and on desktop"), -anchor => "w");
+        $back_config_set->Label(-text => __("Create shortcuts in Start menu"), -anchor => "w");
       push @config_set_m,
+        $back_config_set->Label(-textvariable => \$changeddefaults{"menu_integration"}{'display'});
+      push @config_set_r,
+        $back_config_set->Button(-text => __("Toggle"),
+          -command => sub { toggle_setting("menu_integration"); });
+  
+      push @config_set_l,
+        $back_config_set->Label(-text => __("Create shortcuts on the desktop"), -anchor => "w");
+      push @config_set_m,
         $back_config_set->Label(-textvariable => \$changeddefaults{"desktop_integration"}{'display'});
       push @config_set_r,
         $back_config_set->Button(-text => __("Toggle"),