2
0
Эх сурвалжийг харах

The Compiler IDE's New Script Wizard now offers to create a shortcut to the main executable in the common Start Menu Programs folder instead of creating a new Start Menu folder especially for the application. This option is enabled by default and is recommended by Microsoft unless you install a suite of applications rather than a single application. Closes #168.

Also updated some labels to say 'shortcut' instead of 'icon'.
Martijn Laan 10 жил өмнө
parent
commit
bca6288d78

+ 2 - 2
Projects/CompMsgs.pas

@@ -42,8 +42,8 @@ const
   SWizardAppFilesSubDirsMessage = 'Should files in subfolders of "%s" also be included?';
   SWizardAppExeFilter = 'Application files (*.exe)|*.exe|All Files|*.*';
   SWizardAppExeDefaultExt = 'exe';
-  SWizardAppIcons = 'Application Icons';
-  SWizardAppIcons2 = 'Please specify which icons should be created for your application.';
+  SWizardAppIcons = 'Application Shortcuts';
+  SWizardAppIcons2 = 'Please specify which shortcuts should be created for your application.';
   SWizardAppDocs = 'Application Documentation';
   SWizardAppDocs2 = 'Please specify which documentation files should be shown by Setup during installation.';
   SWizardAppDocsFilter = 'Documentation files (*.rtf,*.txt)|*.rtf;*.txt|All Files|*.*';

BIN
Projects/CompWizard.dfm


+ 36 - 23
Projects/CompWizard.dfm.txt

@@ -1233,83 +1233,96 @@ object WizardForm: TWizardForm
           Caption = 'AppIcons'
           object AppGroupNameLabel: TNewStaticText
             Left = 36
-            Top = 8
+            Top = 28
             Width = 413
             Height = 16
             AutoSize = False
             Caption = 'Application &Start Menu folder name:'
             FocusControl = AppGroupNameEdit
-            TabOrder = 0
+            TabOrder = 1
             WordWrap = True
           end
           object AppExeIconsLabel: TNewStaticText
             Left = 36
-            Top = 140
+            Top = 160
             Width = 413
             Height = 16
             AutoSize = False
-            Caption = 'Other main executable icons:'
+            Caption = 'Other shortcuts to the main executable:'
             FocusControl = AppDirNameEdit
-            TabOrder = 6
+            TabOrder = 7
             WordWrap = True
           end
           object AppGroupNameEdit: TEdit
             Left = 36
-            Top = 28
+            Top = 48
             Width = 309
             Height = 21
-            TabOrder = 1
+            TabOrder = 2
           end
           object NotDisableProgramGroupPageCheck: TCheckBox
             Left = 36
-            Top = 56
+            Top = 76
             Width = 425
             Height = 17
             Caption = 'Allow user to &change the Start Menu folder name'
-            TabOrder = 2
+            TabOrder = 3
             OnClick = NotDisableProgramGroupPageCheckClick
           end
           object AllowNoIconsCheck: TCheckBox
             Left = 36
-            Top = 76
+            Top = 96
             Width = 425
             Height = 17
             Caption = 'Allow user to &disable Start Menu folder creation'
-            TabOrder = 3
+            TabOrder = 4
           end
           object DesktopIconCheck: TCheckBox
             Left = 36
-            Top = 160
+            Top = 180
             Width = 257
             Height = 17
-            Caption = 'Allow user to create a deskto&p icon'
-            TabOrder = 7
+            Caption = 'Allow user to create a deskto&p shortcut'
+            TabOrder = 8
             OnClick = NotCreateAppDirCheckClick
           end
           object QuickLaunchIconCheck: TCheckBox
             Left = 36
-            Top = 180
-            Width = 257
+            Top = 200
+            Width = 421
             Height = 17
-            Caption = 'Allow user to create a &Quick Launch icon'
-            TabOrder = 8
+            Caption = 
+              'Allow user to create a &Quick Launch shortcut on older versions ' +
+              'of Windows'
+            TabOrder = 9
             OnClick = NotCreateAppDirCheckClick
           end
           object CreateUninstallIconCheck: TCheckBox
             Left = 36
-            Top = 116
+            Top = 136
             Width = 301
             Height = 17
-            Caption = 'Create an &Uninstall icon in the Start Menu folder'
-            TabOrder = 5
+            Caption = 'Create an &Uninstall shortcut in the Start Menu folder'
+            TabOrder = 6
           end
           object CreateURLIconCheck: TCheckBox
             Left = 36
-            Top = 96
+            Top = 116
             Width = 301
             Height = 17
             Caption = 'Create an &Internet shortcut in the Start Menu folder'
-            TabOrder = 4
+            TabOrder = 5
+          end
+          object UseCommonProgramsCheck: TCheckBox
+            Left = 36
+            Top = 8
+            Width = 425
+            Height = 17
+            Caption = 
+              '&Create a shortcut to the main executable in the common Start Me' +
+              'nu Programs folder'
+            TabOrder = 0
+            OnClick = UseCommonProgramsCheckClick
           end
         end
         object TPage

+ 57 - 20
Projects/CompWizard.pas

@@ -2,13 +2,11 @@ unit CompWizard;
 
 {
   Inno Setup
-  Copyright (C) 1997-2010 Jordan Russell
+  Copyright (C) 1997-2015 Jordan Russell
   Portions by Martijn Laan
   For conditions of distribution and use, see LICENSE.TXT.
 
   Compiler Script Wizard form
-
-  $jrsoftware: issrc/Projects/CompWizard.pas,v 1.68 2011/04/16 05:51:19 jr Exp $
 }
 
 interface
@@ -108,6 +106,7 @@ type
     AllLanguagesButton: TButton;
     NoLanguagesButton: TButton;
     NoAppExeCheck: TCheckBox;
+    UseCommonProgramsCheck: TCheckBox;
     procedure FormCreate(Sender: TObject);
     procedure FormShow(Sender: TObject);
     procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
@@ -132,6 +131,7 @@ type
     procedure AllLanguagesButtonClick(Sender: TObject);
     procedure NoLanguagesButtonClick(Sender: TObject);
     procedure NoAppExeCheckClick(Sender: TObject);
+    procedure UseCommonProgramsCheckClick(Sender: TObject);
   private
     CurPage: TWizardPage;
     FWizardName: String;
@@ -149,6 +149,7 @@ type
     procedure UpdateWizardFiles;
     procedure UpdateWizardFilesButtons;
     procedure UpdateAppExeControls;
+    procedure UpdateAppIconsControls;
     procedure GenerateScript;
   public
     property WizardName: String write SetWizardName;
@@ -315,6 +316,7 @@ begin
   UpdateWizardFilesButtons;
 
   { AppIcons }
+  UseCommonProgramsCheck.Checked := True;
   NotDisableProgramGroupPageCheck.Checked := True;
   DesktopIconCheck.Checked := True;
 
@@ -409,7 +411,13 @@ begin
         else
           ActiveControl := AppFilesListBox;
       end;
-    wpAppIcons: ActiveControl := AppGroupNameEdit;
+    wpAppIcons:
+      begin
+        if UseCommonProgramsCheck.Enabled then
+          ActiveControl := UseCommonProgramsCheck
+        else
+          ActiveControl := AppGroupNameEdit;
+      end;
     wpAppDocs: ActiveControl := AppLicenseFileEdit;
     wpLanguages: ActiveControl := LanguagesList;
     wpCompiler: ActiveControl := OutputDirEdit;
@@ -519,11 +527,7 @@ begin
     { Even if we're skipping a page, we should still update it }
     case CurPage of
       wpAppDir: if AppDirNameEdit.Text = '' then AppDirNameEdit.Text := AppNameEdit.Text;
-      wpAppIcons:
-        begin
-          if AppGroupNameEdit.Text = '' then AppGroupNameEdit.Text := AppNameEdit.Text;
-          CreateURLIconCheck.Enabled := AppURLEdit.Text <> '';
-        end;
+      wpAppIcons: if AppGroupNameEdit.Text = '' then AppGroupNameEdit.Text := AppNameEdit.Text;
     end;
   until not SkipCurPage;
 
@@ -608,6 +612,28 @@ begin
     AppExeLabel.Font.Style := AppExeLabel.Font.Style - [fsBold];
 end;
 
+procedure TWizardForm.UpdateAppIconsControls;
+var
+  Enabled: Boolean;
+begin
+  UseCommonProgramsCheck.Enabled := NoAppExeCheck.Enabled and not NoAppExeCheck.Checked;
+
+  Enabled := not (UseCommonProgramsCheck.Enabled and UseCommonProgramsCheck.Checked);
+
+  AppGroupNameLabel.Enabled := Enabled;
+  AppGroupNameEdit.Enabled := Enabled;
+  AppGroupNameEdit.Color := EnabledColors[Enabled];
+  NotDisableProgramGroupPageCheck.Enabled := Enabled;
+  AllowNoIconsCheck.Enabled := Enabled and NotDisableProgramGroupPageCheck.Checked;
+  CreateURLIconCheck.Enabled := Enabled and (AppURLEdit.Text <> '');
+  CreateUninstallIconCheck.Enabled := Enabled;
+
+  if Enabled then
+    AppGroupNameLabel.Font.Style := AppGroupNameLabel.Font.Style + [fsBold]
+  else
+    AppGroupNameLabel.Font.Style := AppGroupNameLabel.Font.Style - [fsBold];
+end;
+
 {---}
 
 procedure TWizardForm.AppRootDirComboBoxChange(Sender: TObject);
@@ -663,6 +689,7 @@ end;
 procedure TWizardForm.NoAppExeCheckClick(Sender: TObject);
 begin
   UpdateAppExeControls;
+  UpdateAppIconsControls;
 end;
 
 procedure TWizardForm.AppFilesListBoxClick(Sender: TObject);
@@ -755,10 +782,15 @@ begin
   UpdateWizardFilesButtons;
 end;
 
+procedure TWizardForm.UseCommonProgramsCheckClick(Sender: TObject);
+begin
+  UpdateAppIconsControls;
+end;
+
 procedure TWizardForm.NotDisableProgramGroupPageCheckClick(
   Sender: TObject);
 begin
-  AllowNoIconsCheck.Enabled := NotDisableProgramGroupPageCheck.Checked;
+  UpdateAppIconsControls;
 end;
 
 procedure TWizardForm.FileButtonClick(Sender: TObject);
@@ -927,17 +959,22 @@ begin
 
     { AppGroup }
     if not NotCreateAppDirCheck.Checked then begin
-      Setup := Setup + 'DefaultGroupName=' + AppGroupNameEdit.Text + SNewLine;
-      if not NoAppExeCheck.Checked then
-        Icons := Icons + 'Name: "{group}\' + AppNameEdit.Text + '"; Filename: "{app}\' + AppExeName + '"' + SNewLine;
-      if not NotDisableProgramGroupPageCheck.Checked then
+      if UseCommonProgramsCheck.Enabled and UseCommonProgramsCheck.Checked then begin
         Setup := Setup + 'DisableProgramGroupPage=yes' + SNewLine;
-      if AllowNoIconsCheck.Checked and NotDisableProgramGroupPageCheck.Checked then
-        Setup := Setup + 'AllowNoIcons=yes' + SNewLine;
-      if CreateURLIconCheck.Enabled and CreateURLIconCheck.Checked then
-        Icons := Icons + 'Name: "{group}\{cm:ProgramOnTheWeb,' + AppNameEdit.Text + '}"; Filename: "' + AppURLEdit.Text + '"' + SNewLine;
-      if CreateUninstallIconCheck.Checked then
-        Icons := Icons + 'Name: "{group}\{cm:UninstallProgram,' + AppNameEdit.Text + '}"; Filename: "{uninstallexe}"' + SNewLine;
+        Icons := Icons + 'Name: "{commonprograms}\' + AppNameEdit.Text + '"; Filename: "{app}\' + AppExeName + '"' + SNewLine;
+      end else begin
+        Setup := Setup + 'DefaultGroupName=' + AppGroupNameEdit.Text + SNewLine;
+        if not NoAppExeCheck.Checked then
+          Icons := Icons + 'Name: "{group}\' + AppNameEdit.Text + '"; Filename: "{app}\' + AppExeName + '"' + SNewLine;
+        if not NotDisableProgramGroupPageCheck.Checked then
+          Setup := Setup + 'DisableProgramGroupPage=yes' + SNewLine;
+        if AllowNoIconsCheck.Checked and NotDisableProgramGroupPageCheck.Checked then
+          Setup := Setup + 'AllowNoIcons=yes' + SNewLine;
+        if CreateURLIconCheck.Enabled and CreateURLIconCheck.Checked then
+          Icons := Icons + 'Name: "{group}\{cm:ProgramOnTheWeb,' + AppNameEdit.Text + '}"; Filename: "' + AppURLEdit.Text + '"' + SNewLine;
+        if CreateUninstallIconCheck.Checked then
+          Icons := Icons + 'Name: "{group}\{cm:UninstallProgram,' + AppNameEdit.Text + '}"; Filename: "{uninstallexe}"' + SNewLine;
+      end;
       if DesktopIconCheck.Enabled and DesktopIconCheck.Checked then begin
         Tasks := Tasks + 'Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked' + SNewLine;
         Icons := Icons + 'Name: "{commondesktop}\' + AppNameEdit.Text + '"; Filename: "{app}\' + AppExeName + '"; Tasks: desktopicon' + SNewLine;

+ 1 - 0
whatsnew.htm

@@ -29,6 +29,7 @@ For conditions of distribution and use, see <a href="http://www.jrsoftware.org/f
 <p><a name="5.5.7"></a><span class="ver">5.5.7-dev </span><span class="date">(?)</span></p>
 <ul>
 <li><b>Change in default behavior:</b> As recommended by Microsoft's desktop applications guideline, <tt>DisableWelcomePage</tt> now defaults to <tt>yes</tt>. Additionally <tt>DisableDirPage</tt> and <tt>DisableProgramGroupPage</tt> now default to <tt>auto</tt>. The defaults in all previous versions were <tt>none</tt>.</li>
+<li>The Compiler IDE's New Script Wizard now offers to create a shortcut to the main executable in the common Start Menu Programs folder instead of creating a new Start Menu folder especially for the application. This option is enabled by default and is recommended by Microsoft unless you install a suite of applications rather than a single application.</li>
 <li>The <tt>Attribs</tt> parameter of a [Files] or [Dir] entry may now also include <tt>notcontentindexed</tt> to specify that the file or directory is not to be indexed by the content indexing service.</li>
 <li>Pascal Scripting change: function <tt>RegQueryBinaryValue</tt> can now be used to query any type of registry value and not just <tt>REG_BINARY</tt>-type values.</li>
 <li>The Setup and Uninstall programs are now marked as DEP and ASLR compatible.</li>