Files
RustRaptor/raptor/pkg/osx/raptorlauncher/ViewController.m
T
raptorreplica f7c9b7a02d Vendor raptor source files (was embedded gitlink)
Tree vendored at upstream 0019c5dd; origin + license recorded in
raptor/VENDOR.txt. Windows SDL dev packages excluded via .gitignore.
2026-08-25 22:08:42 +10:00

77 lines
1.6 KiB
Objective-C

//
// ViewController.m
// raptorlauncher
//
// Created by skynettx on 17.04.23.
//
#import "ViewController.h"
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (void)setRepresentedObject:(id)representedObject {
[super setRepresentedObject:representedObject];
// Update the view, if already loaded.
}
- (IBAction)RunRaptor:(id)sender {
pid_t childpid;
childpid = fork();
if (childpid == 0)
{
signal(SIGCHLD, SIG_DFL);
const char* pathraptorsetup = "/Contents/MacOS/raptor.sh";
NSString *mainBundlePath = [[NSBundle mainBundle] bundlePath];
const char * inputString = [mainBundlePath UTF8String];
sprintf((char*)inputString,"%s/%s", inputString, pathraptorsetup);
char* arguments[] = { "sh", (char*)inputString, NULL };
execv("/bin/sh", arguments);
}
else
{
signal(SIGCHLD, SIG_IGN);
}
}
- (IBAction)RunSetup:(id)sender {
pid_t childpid;
childpid = fork();
if (childpid == 0)
{
signal(SIGCHLD, SIG_DFL);
const char* pathraptorsetup = "/Contents/MacOS/raptorsetup.sh";
NSString *mainBundlePath = [[NSBundle mainBundle] bundlePath];
const char * inputString = [mainBundlePath UTF8String];
sprintf((char*)inputString,"%s/%s", inputString, pathraptorsetup);
char* arguments[] = { "sh", (char*)inputString, NULL };
execv("/bin/sh", arguments);
}
else
{
signal(SIGCHLD, SIG_IGN);
}
}
- (IBAction)Quit:(id)sender {
exit(0);
}
@end