Browse Source

QuickStart Pack: Now sets the Inno Setup compiler path in the Inno Script Studio options so that it will find the Inno Setup compiler automatically. Required because Inno Script Studio doesn't officially support Inno Setup 6.

Martijn Laan 5 years ago
parent
commit
8d01e86641
3 changed files with 42 additions and 1 deletions
  1. 32 1
      Projects/CompFileAssoc.pas
  2. 9 0
      Projects/Compil32.dpr
  3. 1 0
      whatsnew.htm

+ 32 - 1
Projects/CompFileAssoc.pas

@@ -2,11 +2,13 @@ unit CompFileAssoc;
 
 {
   Inno Setup
-  Copyright (C) 1997-2018 Jordan Russell
+  Copyright (C) 1997-2020 Jordan Russell
   Portions by Martijn Laan
   For conditions of distribution and use, see LICENSE.TXT.
 
   Functions for registering/unregistering the .iss file association
+
+  Also a function register the compiler path to Inno Script Studio
 }
 
 interface
@@ -14,6 +16,8 @@ interface
 function RegisterISSFileAssociation(const AllowInteractive: Boolean; var AllUsers: Boolean): Boolean;
 procedure UnregisterISSFileAssociation;
 
+procedure RegisterISPathToISStudio;
+
 implementation
 
 uses
@@ -183,4 +187,31 @@ begin
   UnregisterISSFileAssociationDo(GetRootkey, True);
 end;
 
+procedure RegisterISPathToISStudio;
+
+  procedure TrySetKeyValue(const Rootkey: HKEY; const Subkey, ValueName: PChar; const Data: String);
+  var
+    K: HKEY;
+    Disp: DWORD;
+  begin
+    if RegCreateKeyExView(rvDefault, Rootkey, Subkey, 0, nil, 0, KEY_SET_VALUE,
+      nil, K, @Disp) = ERROR_SUCCESS then
+    try
+      RegSetValueEx(K, ValueName, 0, REG_SZ, PChar(Data), (Length(Data)+1)*SizeOf(Data[1]));
+    finally
+      RegCloseKey(K);
+    end;
+  end;
+
+var
+  SelfName: String;
+  Rootkey: HKEY;
+begin
+  Rootkey := HKEY_CURRENT_USER;
+
+  SelfName := NewParamStr(0);
+
+  TrySetKeyValue(Rootkey, 'Software\Kymoto Solutions\Inno Script Studio 2\Options\Compiler', 'InnoCompilerPath', PathExtractDir(SelfName));
+end;
+
 end.

+ 9 - 0
Projects/Compil32.dpr

@@ -156,6 +156,15 @@ begin
       end;
       Halt;
     end
+    else if CompareText(S, '/ASSOCISSTUDIO') = 0 then begin
+      try
+        RegisterISPathToISStudio;
+      except
+        MessageBox(0, PChar(GetExceptMessage), nil, MB_OK or MB_ICONSTOP);
+        Halt(2);
+      end;
+      Halt;
+    end
     else if (S = '') or (S[1] = '/') or (CommandLineFilename <> '') then
       Error
     else

+ 1 - 0
whatsnew.htm

@@ -32,6 +32,7 @@ For conditions of distribution and use, see <a href="https://jrsoftware.org/file
 <ul>
   <li>Compiler IDE change: <a href="https://i.imgur.com/wHoJ3FG.png">Improved highlighting</a> for the [CustomMessages] and [Messages] sections.</li>
   <li>Pascal Scripting change: <i>Fix:</i> Support function <tt>WizardSelectComponents</tt> now also updates component sizes and the current selection's required disk space.</li>
+  <li>QuickStart Pack: Now sets the Inno Setup compiler path in the Inno Script Studio options so that it will find the Inno Setup compiler automatically. Required because Inno Script Studio doesn't officially support Inno Setup 6.</li> 
   <li>Minor tweaks.</li>
 </ul>