-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Renames #149
Renames #149
Conversation
Conflicts: Squirrel/SQRLInstaller.m
@@ -413,6 +428,28 @@ - (RACSignal *)verifyBundleAtURL:(NSURL *)bundleURL usingSignature:(SQRLCodeSign | |||
|
|||
#pragma mark Installation | |||
|
|||
- (RACSignal *)renameTargetIfNeededWithTargetURL:(NSURL *)targetURL sourceURL:(NSURL *)sourceURL { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe call this renamed
target to make it sound less like it's renaming the target on disk?
Also, this method could really use documentation.
// | ||
// Returns a request which can be written to disk for ShipIt to read and | ||
// perform. | ||
- (instancetype)initWithUpdateBundleURL:(NSURL *)updateBundleURL targetBundleURL:(NSURL *)targetBundleURL bundleIdentifier:(NSString *)bundleIdentifier launchAfterInstallation:(BOOL)launchAfterInstallation; | ||
- (instancetype)initWithUpdateBundleURL:(NSURL *)updateBundleURL targetBundleURL:(NSURL *)targetBundleURL bundleIdentifier:(NSString *)bundleIdentifier launchAfterInstallation:(BOOL)launchAfterInstallation allowRename:(BOOL)allowRename; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I’d like to call this useUpdateBundleName
so that it’s clearer what the final name will be, rename
here could imply using or not using rename(2)
.
Alternatively, we could be even more descriptive and make it a targetPathComponent: NSString?
parameter. This would indicate the lastPathComponent
on top of the targetBundleURL.stringByRemovingLastPathComponent
that we’re requesting the update service to put the update into.
Conflicts: Squirrel/SQRLInstaller.m
Alright @keithduncan, see how that strikes you. We still have the |
return [RACSignal return:targetURL]; | ||
} | ||
|
||
NSString *newAppName = [sourceExecutableName stringByAppendingPathExtension:@"app"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use sourceURL.lastPathComponent
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the bundle's executable name is more canonical than what the zipped thing is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mdiep could you tie break on this one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know why these would ever be different at this point. It seems a little weird to me that this is even a key in the Info.plist
. But given that it's there, I agree that it seems more canonical than the URL.
I’d like to get another 👍 from @jspahrsummers (if still interested in maintaining Squirrel.Mac). What do you think we should do about the launchd concern? |
Yeah so this is interesting. It seems like Squirrel has always had this problem. Before:
Now:
Both before and now, after the first step in the update process there's no going back. We could try re-registering the job with the new path, but it's not clear to me if we can since it'd be a different bundle than the original one. But at any rate, it seems like a pre-existing condition so I'd prefer to get this merged and address it later. |
Weird, you’re totally right 😖 I’ll wait to see what @mdiep says about which name to prefer then we can |
IIRC launchd copies the ShipIt executable when the job is submitted. |
Nope 😕 |
Sometimes, apps change their names. Sometimes. Squirrel should support that. We only change the name if:
Also, it should be noted that I have no idea what I'm doing.