Skip to content

Commit 6000cc0

Browse files
authored
Fixed an issue where pgAdmin4 app on macOS cannot auto-update while running on a read-only volume even if present in the Applications folder. #9402
1 parent ef1b69b commit 6000cc0

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

pkg/mac/Info.plist.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@
4545
<key>SYSTEM_VERSION_COMPAT</key>
4646
<string>0</string>
4747
</dict>
48-
<key>LSFileQuarantineEnabled</key>
49-
<true/>
5048
<key>LSHasLocalizedDisplayName</key>
5149
<string>1</string>
5250
<key>LSMinimumSystemVersion</key>
@@ -69,5 +67,7 @@
6967
<string>scripting.sdef</string>
7068
<key>SCMRevision</key>
7169
<string>62f83a7521ae1f32e563795732dff0c9da1b660d-refs/heads/master@{#812354}</string>
70+
<key>LSApplicationCategoryType</key>
71+
<string>public.app-category.developer-tools</string>
7272
</dict>
7373
</plist>

pkg/mac/build-functions.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ _build_runtime() {
6767
}
6868

6969
_create_python_env() {
70+
# Force the current shell to not generate cache during build process
71+
export PYTHONDONTWRITEBYTECODE=1
72+
7073
echo "Creating the Python environment..."
7174
PATH=${PGADMIN_POSTGRES_DIR}/bin:${PATH}
7275
LD_LIBRARY_PATH=${PGADMIN_POSTGRES_DIR}/lib:${LD_LIBRARY_PATH}
@@ -334,6 +337,10 @@ _codesign_binaries() {
334337
return
335338
fi
336339

340+
echo "Purging build-machine pollution (pycache) before signing..."
341+
find "${BUNDLE_DIR}" -name "__pycache__" -type d -exec rm -rf {} +
342+
find "${BUNDLE_DIR}" -name "*.pyc" -delete
343+
337344
if [ -z "${DEVELOPER_ID}" ] ; then
338345
echo "Developer ID Application not found in codesign.conf" >&2
339346
exit 1

runtime/src/js/pgadmin.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@ function startDesktopMode() {
229229
process.env.PGADMIN_INT_KEY = UUID;
230230
process.env.PGADMIN_SERVER_MODE = 'OFF';
231231

232+
// Prevent Python from writing .pyc files to the signed bundle
233+
process.env.PYTHONDONTWRITEBYTECODE = '1';
234+
232235
// Start Page URL
233236
baseUrl = `http://127.0.0.1:${serverPort}`;
234237
startPageUrl = `${baseUrl}/?key=${UUID}`;

0 commit comments

Comments
 (0)