Ver código fonte

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 anos atrás
pai
commit
bca6288d78
5 arquivos alterados com 96 adições e 45 exclusões
  1. 2 2
      Projects/CompMsgs.pas
  2. BIN
      Projects/CompWizard.dfm
  3. 36 23
      Projects/CompWizard.dfm.txt
  4. 57 20
      Projects/CompWizard.pas
  5. 1 0
      whatsnew.htm

+ 2 - 2
Projects/CompMsgs.pas

@@ -42,8 +42,8 @@ const
   SWizardAppFilesSubDirsMessage = 'Should files in subfolders of "%s" also be included?';
   SWizardAppFilesSubDirsMessage = 'Should files in subfolders of "%s" also be included?';
   SWizardAppExeFilter = 'Application files (*.exe)|*.exe|All Files|*.*';
   SWizardAppExeFilter = 'Application files (*.exe)|*.exe|All Files|*.*';
   SWizardAppExeDefaultExt = 'exe';
   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';
   SWizardAppDocs = 'Application Documentation';
   SWizardAppDocs2 = 'Please specify which documentation files should be shown by Setup during installation.';
   SWizardAppDocs2 = 'Please specify which documentation files should be shown by Setup during installation.';
   SWizardAppDocsFilter = 'Documentation files (*.rtf,*.txt)|*.rtf;*.txt|All Files|*.*';
   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'
           Caption = 'AppIcons'
           object AppGroupNameLabel: TNewStaticText
           object AppGroupNameLabel: TNewStaticText
             Left = 36
             Left = 36
-            Top = 8
+            Top = 28
             Width = 413
             Width = 413
             Height = 16
             Height = 16
             AutoSize = False
             AutoSize = False
             Caption = 'Application &Start Menu folder name:'
             Caption = 'Application &Start Menu folder name:'
             FocusControl = AppGroupNameEdit
             FocusControl = AppGroupNameEdit
-            TabOrder = 0
+            TabOrder = 1
             WordWrap = True
             WordWrap = True
           end
           end
           object AppExeIconsLabel: TNewStaticText
           object AppExeIconsLabel: TNewStaticText
             Left = 36
             Left = 36
-            Top = 140
+            Top = 160
             Width = 413
             Width = 413
             Height = 16
             Height = 16
             AutoSize = False
             AutoSize = False
-            Caption = 'Other main executable icons:'
+            Caption = 'Other shortcuts to the main executable:'
             FocusControl = AppDirNameEdit
             FocusControl = AppDirNameEdit
-            TabOrder = 6
+            TabOrder = 7
             WordWrap = True
             WordWrap = True
           end
           end
           object AppGroupNameEdit: TEdit
           object AppGroupNameEdit: TEdit
             Left = 36
             Left = 36
-            Top = 28
+            Top = 48
             Width = 309
             Width = 309
             Height = 21
             Height = 21
-            TabOrder = 1
+            TabOrder = 2
           end
           end
           object NotDisableProgramGroupPageCheck: TCheckBox
           object NotDisableProgramGroupPageCheck: TCheckBox
             Left = 36
             Left = 36
-            Top = 56
+            Top = 76
             Width = 425
             Width = 425
             Height = 17
             Height = 17
             Caption = 'Allow user to &change the Start Menu folder name'
             Caption = 'Allow user to &change the Start Menu folder name'
-            TabOrder = 2
+            TabOrder = 3
             OnClick = NotDisableProgramGroupPageCheckClick
             OnClick = NotDisableProgramGroupPageCheckClick
           end
           end
           object AllowNoIconsCheck: TCheckBox
           object AllowNoIconsCheck: TCheckBox
             Left = 36
             Left = 36
-            Top = 76
+            Top = 96
             Width = 425
             Width = 425
             Height = 17
             Height = 17
             Caption = 'Allow user to &disable Start Menu folder creation'
             Caption = 'Allow user to &disable Start Menu folder creation'
-            TabOrder = 3
+            TabOrder = 4
           end
           end
           object DesktopIconCheck: TCheckBox
           object DesktopIconCheck: TCheckBox
             Left = 36
             Left = 36
-            Top = 160
+            Top = 180
             Width = 257
             Width = 257
             Height = 17
             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
             OnClick = NotCreateAppDirCheckClick
           end
           end
           object QuickLaunchIconCheck: TCheckBox
           object QuickLaunchIconCheck: TCheckBox
             Left = 36
             Left = 36
-            Top = 180
-            Width = 257
+            Top = 200
+            Width = 421
             Height = 17
             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
             OnClick = NotCreateAppDirCheckClick
           end
           end
           object CreateUninstallIconCheck: TCheckBox
           object CreateUninstallIconCheck: TCheckBox
             Left = 36
             Left = 36
-            Top = 116
+            Top = 136
             Width = 301
             Width = 301
             Height = 17
             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
           end
           object CreateURLIconCheck: TCheckBox
           object CreateURLIconCheck: TCheckBox
             Left = 36
             Left = 36
-            Top = 96
+            Top = 116
             Width = 301
             Width = 301
             Height = 17
             Height = 17
             Caption = 'Create an &Internet shortcut in the Start Menu folder'
             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
         end
         end
         object TPage
         object TPage

+ 57 - 20
Projects/CompWizard.pas

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