Closed Bug 263429 Opened 20 years ago Closed 20 years ago

execute() doesn't work on Mac OSX

Categories

(Core Graveyard :: Installer: XPInstall Engine, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jst, Assigned: jst)

Details

(Keywords: fixed-aviary1.0, fixed1.7.5, Whiteboard: [have patch] need review dveditz)

Attachments

(1 file)

It's impossible to write an xpi wrapper around a Mac installer today because
xpinstall's execute() call doesn't work on Mac OSX. The problem is that
nsProcessCommon in xpcom/threads uses nspr's PR_CreateProcess() etc which don't
work on the mac either. They'd work for creating processes for posix-like
executables (most likely), but not for executing Mac applications.

Patch coming up.
This patch basically copies the app launching logic from nsProcessMac.cpp (no
longer part of the build, and thus now being removed from the tree) into
nsProcessCommon.cpp.
Attachment #161446 - Flags: superreview?(dveditz)
Attachment #161446 - Flags: review?(peterv)
Flags: blocking-aviary1.0mac?
Flags: blocking-aviary1.0?
Flags: blocking-aviary1.0mac?
Flags: blocking-aviary1.0mac+
Flags: blocking-aviary1.0?
Flags: blocking-aviary1.0+
Comment on attachment 161446 [details] [diff] [review]
Make nsProcessCommon::Run() work on Mac OSX

>Index: xpcom/threads/nsProcessCommon.cpp
>===================================================================

>+#elif defined(XP_MACOSX)
>+    LaunchParamBlockRec	launchPB;

Ugh, tabs.

>+    FSSpec resolvedSpec;
>+    OSErr err = noErr;
>+
>+    nsCOMPtr<nsILocalFileMac> macExecutable = do_QueryInterface(mExecutable);
>+    macExecutable->GetFSSpec(&resolvedSpec);
>+

Declare launchPB here.

>+    launchPB.launchAppSpec = &resolvedSpec;


>+    if (blocking && err == noErr) {
>+        while (1) {
>+            ProcessInfoRec info;
>+            info.processInfoLength = sizeof(ProcessInfoRec);
>+            info.processName = nil;
>+            info.processAppSpec = nil;

Use NULL for consistency.
Attachment #161446 - Flags: review?(peterv) → review+
Fixed locally.
Whiteboard: [have patch] need review dveditz
Comment on attachment 161446 [details] [diff] [review]
Make nsProcessCommon::Run() work on Mac OSX

sr=dveditz
Attachment #161446 - Flags: superreview?(dveditz) → superreview+
Attachment #161446 - Flags: approval1.7.x?
Attachment #161446 - Flags: approval-aviary?
Comment on attachment 161446 [details] [diff] [review]
Make nsProcessCommon::Run() work on Mac OSX

a=chofmann for the branches
Attachment #161446 - Flags: approval1.7.x?
Attachment #161446 - Flags: approval1.7.x+
Attachment #161446 - Flags: approval-aviary?
Attachment #161446 - Flags: approval-aviary+
Fixed on trunk and branches.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
This caused bug 267269 (passing arguments to nsIProcess no longer works).
Though I guess before it just silently didn't pass the args, while now it
throws, eh?
Though bug 267269 claims that the new process got the args somehow...
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: