Last active
November 14, 2021 05:25
-
-
Save xorrior/86948fb6782efe87f26a704e81dbf0fc to your computer and use it in GitHub Desktop.
Installer Plugin that pops a message box to the user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// MyInstallerPane.m | |
// messagebox | |
// | |
// Created by Chris Ross on 1/23/18. | |
// Copyright © 2018 testplugin. All rights reserved. | |
// | |
/* | |
This should be in MyInstallerPane.h | |
#import <InstallerPlugins/InstallerPlugins.h> | |
@interface MyInstallerPane : InstallerPane | |
@end | |
*/ | |
#import "MyInstallerPane.h" | |
#import <Foundation/Foundation.h> | |
@implementation MyInstallerPane | |
- (NSString *)title | |
{ | |
return [[NSBundle bundleForClass:[self class]] localizedStringForKey:@"PaneTitle" value:nil table:nil]; | |
} | |
- (void)didEnterPane:(InstallerSectionDirection)dir | |
{ | |
//Malicious logic when entering pane | |
NSAlert *alert = [[NSAlert alloc] init]; | |
[alert setMessageText:@"Are you sure you want to install my malware?"]; | |
[alert setInformativeText:@"Remember, you WANTED this...."]; | |
[alert addButtonWithTitle:@"OK"]; | |
[alert addButtonWithTitle:@"Cancel"]; | |
[alert setAlertStyle:NSInformationalAlertStyle]; | |
NSInteger result = [alert runModal]; | |
if (result == NSAlertFirstButtonReturn) { | |
NSLog(@"first button clicked"); | |
} else if (result == NSAlertSecondButtonReturn) { | |
NSLog(@"Second button clicked"); | |
} | |
} | |
- (void) willEnterPane:(InstallerSectionDirection)dir { | |
//Malicious logic when ???? | |
} | |
- (BOOL)shouldExitPane:(InstallerSectionDirection)dir | |
{ | |
return YES; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello @xorrior , I am working on an Installer Plugin that opens the browser with a pre specified URL, I am unable to get help on this since I am new to macOS and Installer Plugins, can you help me with it, the problem I am dealing with is that I have the functions in C++/ObjC but I am unable to call them, Please help