Skip to content

Commit

Permalink
Added nomenuitems attribute to install tag.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed May 18, 2006
1 parent 4681d2f commit d45b18a
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Ryan C. Gordon (???) - Thu May 18 03:37:58 PDT 2006
* EULAs can be optionally skipped when doing a reinstall.
* Reinstall can now be completely noninteractive, for automatic upgrades of
existing installations to newer versions.
* Added nomenuitems attribute to install tag.
Ryan C. Gordon (???) - Wed May 17 17:33:25 PDT 2006
* Fixed an incorrect gladefile reference (gtk+ warning on symlink checkbox).
Stephane Peter (Codehost) - Wed Mar 29 15:37:18 PST 2006
Expand Down
3 changes: 3 additions & 0 deletions README.xml
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ There are several optional attributes of the install element:
nopromptoverwrite If set to 'yes' existing files will be overwritten without
prompting the user. This was the default before setup 1.6.4

nomenuitems If set to 'yes', menu items for Gnome/KDE/etc will not be installed, and the
user will not be prompted about installing them.

appbundleid (CARBON ONLY) This string means that you are installing new files into an existing
Application Bundle. If the bundle isn't found, the installation aborts, otherwise, all
files are added relative to the base of the app bundle. The string specified here is
Expand Down
2 changes: 1 addition & 1 deletion carbon_ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ static void OnCommandContinue()
}

// Install desktop menu items
if(!GetProductHasNoBinaries(cur_info))
if((!GetProductHasNoBinaries(cur_info)) && (GetProductInstallMenuItems(cur_info)))
cur_info->options.install_menuitems = 1;

carbon_ShowInstallScreen(MyRes, OPTION_PAGE);
Expand Down
4 changes: 2 additions & 2 deletions console_ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ static install_state console_setup(install_info *info)

if ( express_setup ) {
/* Install desktop menu items */
if ( !GetProductHasNoBinaries(info) ) {
if((!GetProductHasNoBinaries(info)) && (GetProductInstallMenuItems(info))) {
info->options.install_menuitems = 1;
}
return SETUP_INSTALL;
Expand Down Expand Up @@ -565,7 +565,7 @@ static install_state console_setup(install_info *info)
}

/* Ask for desktop menu items */
if ( !GetProductHasNoBinaries(info) &&
if ( !GetProductHasNoBinaries(info) && (GetProductInstallMenuItems(info)) &&
console_prompt(_("Do you want to install startup menu entries?"),
RESPONSE_YES) == RESPONSE_YES ) {
info->options.install_menuitems = 1;
Expand Down
6 changes: 3 additions & 3 deletions dialog_ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* "dialog"-based UI frontend for setup.
* Dialog was turned into a library, shell commands are not called.
*
* $Id: dialog_ui.c,v 1.35 2006-03-29 23:38:28 megastep Exp $
* $Id: dialog_ui.c,v 1.36 2006-05-18 19:49:45 icculus Exp $
*/

#include <limits.h>
Expand Down Expand Up @@ -536,7 +536,7 @@ install_state dialog_setup(install_info *info)

clear_the_screen();
/* Ask for desktop menu items */
if ( !GetProductHasNoBinaries(info) &&
if ( !GetProductHasNoBinaries(info) && (GetProductInstallMenuItems(info)) &&
dialog_prompt(_("Do you want to install startup menu entries?"),
RESPONSE_YES) == RESPONSE_YES ) {
info->options.install_menuitems = 1;
Expand All @@ -547,7 +547,7 @@ install_state dialog_setup(install_info *info)
}
} else { /* Express setup */
/* Install desktop menu items */
if ( !GetProductHasNoBinaries(info)) {
if((!GetProductHasNoBinaries(info)) && (GetProductInstallMenuItems(info))) {
info->options.install_menuitems = 1;
}
}
Expand Down
7 changes: 4 additions & 3 deletions gtk_ui.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* GTK-based UI
$Id: gtk_ui.c,v 1.123 2006-05-18 12:25:06 icculus Exp $
$Id: gtk_ui.c,v 1.124 2006-05-18 19:49:46 icculus Exp $
*/

/* Modifications by Borland/Inprise Corp.
Expand Down Expand Up @@ -405,7 +405,7 @@ void on_class_continue_clicked( GtkWidget *w, gpointer data )
}
}
/* Install desktop menu items */
if ( !GetProductHasNoBinaries(cur_info)) {
if((!GetProductHasNoBinaries(cur_info)) && (GetProductInstallMenuItems(cur_info))) {
cur_info->options.install_menuitems = 1;
}
widget = glade_xml_get_widget(setup_glade, "setup_notebook");
Expand Down Expand Up @@ -1370,10 +1370,11 @@ static void init_menuitems_option(install_info *info)

widget = glade_xml_get_widget(setup_glade, "setup_menuitems_checkbox");
if ( widget ) {
if ( ! GetProductHasNoBinaries(info) ) {
if ( ( ! GetProductHasNoBinaries(info) ) && ( GetProductInstallMenuItems(info) ) ) {
setup_checkbox_menuitems_slot(widget, NULL);
} else {
gtk_widget_hide(widget);
info->options.install_menuitems = 0;
}
} else {
log_warning(_("Unable to locate 'setup_menuitems_checkbox'"));
Expand Down
16 changes: 15 additions & 1 deletion install.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $Id: install.c,v 1.175 2006-05-18 12:25:06 icculus Exp $ */
/* $Id: install.c,v 1.176 2006-05-18 19:49:46 icculus Exp $ */

/* Modifications by Borland/Inprise Corp.:
04/10/2000: Added code to expand ~ in a default path immediately after
Expand Down Expand Up @@ -380,6 +380,20 @@ int GetProductReinstallFast(install_info *info)
return ret;
}

int GetProductInstallMenuItems(install_info *info)
{
int ret = 1; /* yes */
char *str = (char *)xmlGetProp(XML_ROOT(info->config), BAD_CAST "nomenuitems");
if ( str && (!strcasecmp(str, "yes") || !strcasecmp(str, "true"))) {
ret = 0; /* no */
}
if (str) {
xmlFree(str);
}
return ret;
}


/* returns true if any deviant paths are not writable. If path_ret is non-NULL
* it must point to a buffer of at least PATH_MAX characters. The first not
* writeable path is stored there if return value is true
Expand Down
3 changes: 3 additions & 0 deletions install.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@ extern int GetProductPromptOverwrite(install_info *info);
/** whether the product should reinstall with _zero_ user interaction. */
int GetProductReinstallFast(install_info *info);

/** whether the product should not installe Gnome/KDE/etc menu items */
int GetProductInstallMenuItems(install_info *info);

/** check if product can be installed. Returns NULL if product can be
* installed, otherwise reason why not. */
extern const char *IsReadyToInstall(install_info *info);
Expand Down

0 comments on commit d45b18a

Please sign in to comment.