Skip to content
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

What is the recommended way to change an app name, including the path of .app, when updating? #1442

Closed
jfenton-tsc opened this issue Aug 1, 2019 · 4 comments

Comments

@jfenton-tsc
Copy link
Contributor

jfenton-tsc commented Aug 1, 2019

I'm running into trouble figuring out how to set our app up for a name change--mostly because I'm misunderstanding things, I think. In short, we want to push an update where the app is renamed from Old App Name.app to Name App Name.app, in the Applications folder.

I've looked at the following issues to try and make this behavior work:

#400
#469
#782

I'll try to run down how we have things set up, the behavior we want, and the behavior we're seeing instead:

Description of the problem

The current version is configured like this:
filename: Old App Name.app
bundle name: Old App Name
bundle identifier: com.company.oldappname

in the Info.plist for the app, we have:

<key>SUBundleName</key>
<string>New App Name</string>

NOTE: prior to adding this SUBundleName to the plist, Sparkle emitted an error where, during extraction of the update, it couldn't find a .app or .pkg of the expected name; (that being Old App Name.app). It seems SUBundleName has fixed this.

in the xcconfig for Sparkle, we have:

SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME = 1

The 'update' is configured like this:
filename: New App Name.app
bundle name: New App Name
bundle identifier: com.company.oldappname

NOTE: we found changing the bundle identifier broke Sparkle's codesign verification, so we're just... not going to change it.

The behavior we expect:

  1. currently installed Old App Name.app detects an update. It either prompts the user to install or runs automatically--however it's configured.
  2. it downloads the DMG (or zip) specified in its appcast, then extracts files from it.
  3. it looks for a .app or .pkg that matches SUBundleName, in this case New App Name.app
  4. it copies that .app to a temporary folder, then copies it over the currently-installed app and restarts.

This is where what I expect and what happens differ:

Because SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME=1 and SUBundleName are both set, I would expect the installed Old App Name.app to be renamed to New App Name.app--instead, it's left as Old App Name.app, or set back to Old App Name.app if it had been changed previously.

Do you use Sandboxing in your app?

No.

Version of Sparkle.framework in the latest version of your app

1.20.0

Version of Sparkle.framework in the old version of app that your users have (or N/A)

1.20.0

Sparkle's output from Console.app

None relevant.

Steps to reproduce the behavior

See above.

@kornelski
Copy link
Member

It sounds like a bug/missing feature. It would make sense to rename the app when SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME is set.

@jfenton-tsc
Copy link
Contributor Author

I think the change needed would be in SUInstaller.m, method normalizedInstallationPathForHost--instead of just pulling the path off of the host bundle, it would check to see if SUBundleIdentifier is set. Does that sound right?

I'm happy to put up the PR, I'm just sanity-checking my thoughts before I start hacking :)

@kornelski
Copy link
Member

Yup, sounds fine

@jfenton-tsc
Copy link
Contributor Author

Pr is up: #1444

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants