Skip to content

Commit

Permalink
Updating works!
Browse files Browse the repository at this point in the history
What we still gotta do:
- Make the update notes look better
- Stop the generate_appcasts.py script from generating entries for so many old and unnecessary
 releases
- Make updates and beta channel stuff behave properly (Channel setting isn't used when starting the app up)
- Close more sheet when update commences
- Share my script in that github discussion at sparkle-project/Sparkle#648
- Think about where to put the appcasts (we need to commit to that because it's hardcoded into the app)
  • Loading branch information
noah-nuebling committed Apr 30, 2021
1 parent 3a037ce commit 73991d8
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 23 deletions.
9 changes: 2 additions & 7 deletions App/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#import "AppTranslocationManager.h"
#import "MessagePort_App.h"
#import <Sparkle/Sparkle.h>
#import "SparkleUpdaterController.h"

@interface AppDelegate ()

Expand Down Expand Up @@ -187,13 +188,7 @@ - (void)applicationDidFinishLaunching:(NSNotification *)notification {

NSString *feedURLString;

if (checkForPrereleases) {
feedURLString = fstring(@"%@/%@", kMFRawRepoAddress, kSUFeedURLSubBeta);
} else {
feedURLString = fstring(@"%@/%@", kMFRawRepoAddress, kSUFeedURLSub);
}

up.feedURL = [NSURL URLWithString:feedURLString];
[SparkleUpdaterController enablePrereleaseChannel:checkForPrereleases];

[up checkForUpdatesInBackground];
}
Expand Down
9 changes: 4 additions & 5 deletions App/Base.lproj/MouseFix.xib
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="17701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="17701"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand Down Expand Up @@ -62,7 +61,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<clipView key="contentView" drawsBackground="NO" id="S62-75-wtd">
<rect key="frame" x="0.0" y="0.0" width="540" height="254"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<tableView identifier="remapTable" verticalHuggingPriority="750" allowsExpansionToolTips="YES" tableStyle="fullWidth" columnReordering="NO" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" rowHeight="39" rowSizeStyle="automatic" viewBased="YES" floatsGroupRows="NO" id="zJh-jy-oKM" customClass="MFTableView">
<rect key="frame" x="0.0" y="0.0" width="540" height="254"/>
Expand Down Expand Up @@ -179,14 +178,14 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<clipView key="contentView" focusRingType="exterior" drawsBackground="NO" id="2dn-db-91A">
<rect key="frame" x="0.0" y="0.0" width="211" height="20"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<textView identifier="keyCaptureView" focusRingType="exterior" editable="NO" drawsBackground="NO" importsGraphics="NO" richText="NO" verticallyResizable="NO" allowsCharacterPickerTouchBarItem="NO" textCompletion="NO" id="JcL-EN-Rma" customClass="KeyCaptureView">
<rect key="frame" x="0.0" y="0.0" width="206" height="19"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
<size key="minSize" width="206" height="19"/>
<size key="minSize" width="208" height="19"/>
<size key="maxSize" width="295" height="10000000"/>
<attributedString key="textStorage">
<fragment content="Text go here">
Expand Down Expand Up @@ -357,7 +356,7 @@ Tips:
<outlet property="delegate" destination="iab-hA-K07" id="gdw-fE-nvv"/>
</connections>
</customObject>
<customObject id="iab-hA-K07" customClass="SparkleUpdaterDelegate"/>
<customObject id="iab-hA-K07" customClass="SparkleUpdaterController"/>
<menuItem title="Launchpad" tag="160" id="9rC-Ff-2hb"/>
<menu title="Main Menu" systemMenu="main" id="DQZ-tv-r6C">
<items>
Expand Down
4 changes: 3 additions & 1 deletion App/MoreSheet/MoreSheet.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#import "AppDelegate.h"
#import "Utility_App.h"
#import <Sparkle/Sparkle.h>
#import "SparkleUpdaterController.h"


@interface MoreSheet ()
Expand Down Expand Up @@ -50,7 +51,8 @@ - (IBAction)checkForUpdateCheckBox:(NSButton *)sender {
}
- (IBAction)prereleaseCheckBox:(NSButton *)sender {
[self updateConfigFileToUIState];
if (sender.state == 1) {
[SparkleUpdaterController enablePrereleaseChannel:sender.state];
if (sender.state == 1) {
[SUUpdater.sharedUpdater checkForUpdatesInBackground];
}
}
Expand Down
2 changes: 1 addition & 1 deletion App/SupportFiles/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>306</string>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>NSHumanReadableCopyright</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@

NS_ASSUME_NONNULL_BEGIN

@interface SparkleUpdaterDelegate : NSObject <SUUpdaterDelegate>
@interface SparkleUpdaterController : NSObject <SUUpdaterDelegate>

+ (void)enablePrereleaseChannel:(BOOL)pre;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,21 @@
// --------------------------------------------------------------------------
//

#import "SparkleUpdaterDelegate.h"
#import "SparkleUpdaterController.h"
#import "AppDelegate.h"
#import "SharedUtility.h"

// See https://sparkle-project.org/documentation/customization/

@implementation SparkleUpdaterDelegate
@implementation SparkleUpdaterController

+ (void)enablePrereleaseChannel:(BOOL)pre {
if (pre) {
SUUpdater.sharedUpdater.feedURL = [NSURL URLWithString:fstring(@"%@/%@", kMFRawRepoAddress, kSUFeedURLSubBeta)];
} else {
SUUpdater.sharedUpdater.feedURL = [NSURL URLWithString:fstring(@"%@/%@", kMFRawRepoAddress, kSUFeedURLSub)];
}
}

- (BOOL)updaterShouldPromptForPermissionToCheckForUpdates:(SUUpdater *)updater {
return NO;
Expand Down
14 changes: 8 additions & 6 deletions Mouse Fix.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
4F37FAD825FDFDC5004C34C4 /* MFScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F37FAD725FDFDC4004C34C4 /* MFScrollView.m */; };
4F39BC26263AC31600FDF692 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4F39BC24263AC2E800FDF692 /* Sparkle.framework */; };
4F39BC27263AC31600FDF692 /* Sparkle.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4F39BC24263AC2E800FDF692 /* Sparkle.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
4F39BC3B263AF2B000FDF692 /* SparkleUpdaterDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F39BC3A263AF2B000FDF692 /* SparkleUpdaterDelegate.m */; };
4F39BC3B263AF2B000FDF692 /* SparkleUpdaterController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F39BC3A263AF2B000FDF692 /* SparkleUpdaterController.m */; };
4F39BC4A263B179200FDF692 /* AppState.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F39BC49263B179200FDF692 /* AppState.m */; };
4F44FEF82606A5C100926A5E /* default_config.plist in Resources */ = {isa = PBXBuildFile; fileRef = 4F44FEF72606A5C100926A5E /* default_config.plist */; };
4F44FF042606D73D00926A5E /* SharedMessagePort.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F44FF032606D73D00926A5E /* SharedMessagePort.m */; };
Expand Down Expand Up @@ -213,8 +213,8 @@
4F37FAD625FDFDC4004C34C4 /* MFScrollView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MFScrollView.h; sourceTree = "<group>"; };
4F37FAD725FDFDC4004C34C4 /* MFScrollView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MFScrollView.m; sourceTree = "<group>"; };
4F39BC24263AC2E800FDF692 /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Sparkle.framework; sourceTree = "<group>"; };
4F39BC39263AF2B000FDF692 /* SparkleUpdaterDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SparkleUpdaterDelegate.h; sourceTree = "<group>"; };
4F39BC3A263AF2B000FDF692 /* SparkleUpdaterDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SparkleUpdaterDelegate.m; sourceTree = "<group>"; };
4F39BC39263AF2B000FDF692 /* SparkleUpdaterController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SparkleUpdaterController.h; sourceTree = "<group>"; };
4F39BC3A263AF2B000FDF692 /* SparkleUpdaterController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SparkleUpdaterController.m; sourceTree = "<group>"; };
4F39BC48263B179200FDF692 /* AppState.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppState.h; sourceTree = "<group>"; };
4F39BC49263B179200FDF692 /* AppState.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppState.m; sourceTree = "<group>"; };
4F39BC5C263B401E00FDF692 /* generate_appcasts.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = generate_appcasts.sh; sourceTree = "<group>"; };
Expand Down Expand Up @@ -811,8 +811,8 @@
4FF665C625F2C92700689B77 /* Update */ = {
isa = PBXGroup;
children = (
4F39BC39263AF2B000FDF692 /* SparkleUpdaterDelegate.h */,
4F39BC3A263AF2B000FDF692 /* SparkleUpdaterDelegate.m */,
4F39BC39263AF2B000FDF692 /* SparkleUpdaterController.h */,
4F39BC3A263AF2B000FDF692 /* SparkleUpdaterController.m */,
);
path = Update;
sourceTree = "<group>";
Expand Down Expand Up @@ -1458,7 +1458,7 @@
4FF665ED25F2C92700689B77 /* MFSegmentedControl.m in Sources */,
4FF6660225F2C92700689B77 /* ClickableImageView.m in Sources */,
4F79A81C2604317200076A7E /* MFNotificationController.m in Sources */,
4F39BC3B263AF2B000FDF692 /* SparkleUpdaterDelegate.m in Sources */,
4F39BC3B263AF2B000FDF692 /* SparkleUpdaterController.m in Sources */,
4F1C51DA260543DD007F4930 /* NSTextField+Additions.m in Sources */,
4F2F5DA825FB6FFD0037660A /* AddWindowController.m in Sources */,
4FF6655025F2C7B000689B77 /* NSArray+Additions.m in Sources */,
Expand Down Expand Up @@ -1640,6 +1640,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 320;
DEVELOPMENT_TEAM = H6Z6W2F7ZZ;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1668,6 +1669,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 320;
DEVELOPMENT_TEAM = H6Z6W2F7ZZ;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand Down

0 comments on commit 73991d8

Please sign in to comment.