Skip to content

Commit 2f92db2

Browse files
committed
fix: copy functions-*.ini files to the right folder, add iconset
ini files no go to the "Resources" dir in the app bundle, not "MacOS". This probably caused the failing notarization. Refs #2238
1 parent c34bde3 commit 2f92db2

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

create-macos-app.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ APP_DIR="$(pwd)/${BUNDLE_NAME}"
1111
EXECUTABLE_SRC="$(pwd)/out/heidisql"
1212
EXECUTABLE_TRG="${APP_DIR}/Contents/MacOS/${APP_NAME}"
1313

14-
# Directory that contains your ini files
15-
INI_SOURCE_DIR="$(pwd)/extra/ini" # change if needed
16-
1714
# Homebrew prefix (auto-detected; override if needed)
1815
BREW_PREFIX="$(brew --prefix 2>/dev/null || echo "/opt/homebrew")"
1916

@@ -80,13 +77,16 @@ cat > "${APP_DIR}/Contents/Info.plist" <<EOF
8077
<string>15.0</string>
8178
<key>NSHighResolutionCapable</key>
8279
<true/>
80+
<key>CFBundleIconFile</key>
81+
<string>heidisql</string>
8382
</dict>
8483
</plist>
8584
EOF
8685

8786

8887
### COPY INI FILES INTO RESOURCES
89-
cp ${INI_SOURCE_DIR}/*.ini "${APP_DIR}/Contents/MacOS/"
88+
cp extra/ini/*.ini "${APP_DIR}/Contents/Resources/"
89+
cp res/heidisql.icns "${APP_DIR}/Contents/Resources/"
9090

9191

9292
### FUNCTION: COPY A DYLIB AND ITS DEPENDENCIES

res/heidisql.icns

194 KB
Binary file not shown.

source/apphelpers.pas

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ TAppSettings = class(TObject)
358358
//function GetTempDir: String;
359359
function GetAppDir: String;
360360
function GetLibDir: String;
361+
function GetResourcesDir: String;
361362
procedure SaveUnicodeFile(Filename: String; Text: String; Encoding: TEncoding);
362363
procedure OpenTextFile(const Filename: String; out Stream: TFileStream; var Encoding: TEncoding);
363364
function DetectEncoding(Stream: TStream): TEncoding;
@@ -1317,6 +1318,16 @@ function GetLibDir: String;
13171318
{$ENDIF}
13181319
end;
13191320

1321+
function GetResourcesDir: String;
1322+
begin
1323+
// point to resources dir in macOS app bundle
1324+
{$IFDEF DARWIN}
1325+
Result := GetAppDir + '..' + DirectorySeparator + 'Resources' + DirectorySeparator;
1326+
{$ELSE}
1327+
Result := GetAppDir;
1328+
{$ENDIF}
1329+
end;
1330+
13201331
{**
13211332
Save a textfile with unicode
13221333
}

source/dbconnection.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11382,7 +11382,7 @@ constructor TSQLFunctionList.Create(AOwner: TDBConnection; SQLFunctionsFileOrder
1138211382

1138311383
TryFiles := Explode(',', SQLFunctionsFileOrder);
1138411384
for TryFile in TryFiles do begin
11385-
IniFilePath := GetAppDir + 'functions-'+TryFile+'.ini';
11385+
IniFilePath := GetResourcesDir + 'functions-'+TryFile+'.ini';
1138611386
FOwner.Log(lcDebug, 'Trying '+IniFilePath);
1138711387
if FileExists(IniFilePath) then begin
1138811388
FOwner.Log(lcInfo, 'Reading function definitions from '+IniFilePath);

0 commit comments

Comments
 (0)