88 Commits

Author SHA1 Message Date
Allan Odgaard
8f3f3d9d16 Update deployment version for xibs to 10.12
This was done using search and replace. Presumably it should be done in Xcode so that it can adjust the xib for the new deployment target, otherwise what is the point of storing deployment version in the xib and provide it as a command line argument to the xib compiler as well (only to get a warning if the versions do not match)?
2019-07-07 18:03:30 +02:00
Allan Odgaard
1ef78b3af7 Rename symbols to what’s expected by the 10.14 SDK 2019-06-29 20:14:15 +02:00
Allan Odgaard
5aa58e5543 Do not include $APP_NAME in framework’s bundle identifier
Since we have multiple application targets, it doesn’t make sense with a global APP_NAME variable.

Though if building the frameworks as standalone bundles and embedding them in different applications, we may need some sort of unique component in the bundle identifier, but we currently do not do this (they are all statically linked, so the Info.plist is currently unused).
2019-06-26 23:32:54 +02:00
Allan Odgaard
82de01589f Update deployment target of all xib files to 10.10 2018-10-30 13:46:34 +07:00
Allan Odgaard
f6fa273912 Update coding style for where to place colon after dictionary keys
This follows the Swift style and also makes it possible to align dictionary values using TextMate’s Align Assignments command.
2018-10-07 09:54:45 +02:00
Ronald Wampler
dfecd02e62 Fix typo: 'therefor' → 'therefore' 2018-10-03 20:16:50 +02:00
Allan Odgaard
0e863b76ea Use title case for software update error dialog 2018-07-30 22:37:35 +02:00
Allan Odgaard
177321e3c4 Warn user when running on a read-only file system.
See https://mjtsai.com/blog/2016/06/16/gatekeeper-path-randomization/ for details.
2018-07-30 22:37:35 +02:00
Allan Odgaard
52fda481dc Change beta/nightly software update constants to prerelease/canary 2018-06-28 10:40:27 +02:00
Allan Odgaard
e70791ee89 Rename a bunch of constants to fix deprecation warnings (10.12) 2018-06-16 22:55:30 +02:00
Allan Odgaard
06bd8b2be0 Add a ‘didUpdateFrom’ argument when relaunching during software update 2017-10-08 20:17:43 +02:00
Allan Odgaard
a8b7906a4b Do not hardcode bundle identifier in Caches path 2017-10-08 20:12:14 +02:00
Allan Odgaard
6893bceae6 Accept application/json for version update information 2017-10-08 19:54:32 +02:00
Allan Odgaard
81d1f84a2c Change sw_update.cc → sw_update.mm 2017-10-08 09:13:03 +02:00
Allan Odgaard
e804a57e04 Change name of property setter: isChecking → checking 2017-10-02 20:53:05 +02:00
Allan Odgaard
8d56ad455a Use NSBundle API instead of oak::application_t 2017-10-02 20:53:05 +02:00
Allan Odgaard
5bc450f56f Move instance variables from implementation to interface block 2017-10-02 20:53:05 +02:00
Ronald Wampler
b8143a626c Avoid use of NSRunInformationalAlertPanel (10.9)
Although this is actually deprecated in 10.10, new APIs are available in 10.9 and it will make addressing deprecation warnings when upgrading to 10.10 easier.
2017-05-31 21:58:31 +02:00
Ronald Wampler
9fae8a3192 Update deployment target to 10.9 for all xib files 2017-05-31 10:03:41 +02:00
Allan Odgaard
9d980a07df Remove NSPrincipalClass from framework bundles’s Info.plist
This is not something which is used anywhere and a few of the frameworks does not have a principal class.
2016-10-31 17:30:30 +07:00
mathbunnyru
440414f96c Use nullptr in all C++ files instead of NULL
This brings us a bit of extra type safety, for example where an integer is expected, nullptr should be disallowed by the compiler (unlike NULL).
2016-10-22 21:40:14 +07:00
mathbunnyru
d6db299a8f Changed from NULL to nullptr in variadic templates for portability 2016-10-19 00:59:11 +03:00
Allan Odgaard
7cc017f343 Harmonize all implementations of sharedInstance 2016-09-19 12:54:19 +02:00
Allan Odgaard
46fb745bbe Use perrorf when printing errors with dynamic strings
Also revise error messages to be more consistent.
2016-08-28 17:25:26 +02:00
Allan Odgaard
dbdfa3c6af Add identifying information to perror output 2016-08-21 12:09:30 +02:00
Allan Odgaard
7dd19c0c0e Update deployment target to 10.8 for all xib files 2016-06-22 20:43:28 +02:00
Allan Odgaard
fb7c2cef3f Use NSUserDefaults’s specialized «type»ForKey: 2016-06-20 11:43:40 +02:00
Allan Odgaard
417193e089 Update link dependencies for all targets
Some targets were including headers from frameworks not specified in their link dependencies. For a clean build this could cause an issue because the header was not available at the time of building the target.

The updated link dependencies are also based on what a target’s tests require. Ideally tests would have separate link dependencies, but as we don’t want to maintain this manually, this will have to wait until the build system automatically handles link dependencies.

Currently the commit command uses constants from the CommitWindow framework but should actually not be linked with it. However, the optimizer will strip dead code, so it should not result in much if any difference in the resulting binary and does solve a build dependency issue.
2016-05-07 13:00:55 +02:00
Allan Odgaard
b55ef5b09a Save all xibs with Xcode 7.1 (7B91b)
This was done in an attempt to prevent the warning saying “This file is set to build for a version older than the project deployment target.”

Unfortunately saving all the xibs did not get rid of the warning, even though tehy are all set to have 10.7 as their build target.

The latest xib format does however remove about 10.000 lines of XML.
2015-10-26 23:26:17 +07:00
Allan Odgaard
ebf20acc20 Prefer CFBundleShortVersionString over CFBundleVersion 2014-11-10 09:01:05 +01:00
Allan Odgaard
52455f049e Enable truncation of status text in download window 2014-11-06 13:47:45 +01:00
Allan Odgaard
9831019a55 Save with Xcode 6.1 (6A1052d) 2014-11-06 13:42:22 +01:00
Allan Odgaard
2f1c4c05c4 Do not use ‘timeIntervalSinceNow’ with dates in the past
We previously negated the result but now we instead ask for [[NSDate date] timeIntervalSinceDate:startDate].
2014-08-21 16:07:23 +02:00
Allan Odgaard
603f06d2db Move version comparison out of s/w update framework 2014-04-25 16:55:31 +07:00
Allan Odgaard
1f0e3db472 Remove trailing zeroes from numeric literals
I mainly dislike the trailing zeroes because CGFloat used to be a float but 1.0 is a double (1.0f would be a float). So better to under-specify and let the compiler figure out the proper type.
2014-04-14 14:26:52 +07:00
Allan Odgaard
cf8f796053 Do not use va_start macro with variable reference
This is undefined according to the standard and is a warning with clang-503.0.38.
2014-03-13 20:51:15 +07:00
Allan Odgaard
1e11a30a53 Remove redundant storage keywords for @property
These were required prior to the new 64 bit run-time.
2014-03-05 16:39:54 +07:00
Allan Odgaard
c2397484b8 Use C++11 for loop
Majority of the edits done using the following ruby script:

    def update_loops(src)
      dst, cnt = '', 0

      block_indent, variable = nil, nil
      src.each_line do |line|
        if block_indent
          if line =~ /^#{block_indent}([{}\t])|^\t*$/
            block_indent = nil if $1 == '}'
            line = line.gsub(%r{ ([^a-z>]) \(\*#{variable}\) | \*#{variable}\b | \b#{variable}(->) }x) do
              $1.to_s + variable + ($2 == "->" ? "." : "")
            end
          else
            block_indent = nil
          end
        elsif line =~ /^(\t*)c?iterate\((\w+), (?!diacritics::make_range)(.*\))$/
          block_indent, variable = $1, $2
          line = "#$1for(auto const& #$2 : #$3\n"
          cnt += 1
        end
        dst << line
      end
      return dst, cnt
    end

    paths.each do |path|
      src = IO.read(path)

      cnt = 1
      while cnt != 0
        src, cnt = update_loops(src)
        STDERR << "#{path}: #{cnt}\n"
      end

      File.open(path, "w") { |io| io << src }
    end
2014-03-03 10:34:13 +07:00
Allan Odgaard
e4e80a946c Use std::make_shared 2013-09-03 12:27:20 +02:00
Allan Odgaard
bf1e92b865 Do not use global constructors for fixtures 2013-08-16 22:40:08 +02:00
Allan Odgaard
ee10f79ed4 Fix non-retaining Objective-C property
The ‘lastVersionDownloaded’ property used ‘assign’ (since it used to be an integer) which meant TextMate would likely crash when the property was read (and had a non-nil value), which it would, when TextMate did a version check after already having downloaded an update (but not yet installed and relaunched).

Also drop the atomic requirement of the ‘archive’ property since we no longer access it from multiple threads.
2013-08-03 11:54:52 +02:00
Allan Odgaard
8d51e930e3 Ensure version_less(NULL_STR, «any») → true 2013-08-02 16:21:21 +02:00
Allan Odgaard
33a47898e1 Remove revision field from version_info_t 2013-07-02 18:43:46 +02:00
Allan Odgaard
9adac35f86 Use complex version string during software update checks
While it is simpler to compare a monotonically increasing integer (the revision), we always use the semantic version string in the user interface, meaning that this version string should change together with the revision, which effectively means we are maintaing two version numbers.

We previously embedded the revision in the version string (2.0-alpha.$revision) but when going from alpha → beta, it would be nice to reset the visible counter, so that first beta becomes 2.0-beta.1, furthermore, test versions could benefit from a more descriptive version string, e.g. “2.0-alpha.9439.2+debug” would be the second (semi-public) debug build after “2.0-alpha.9439”.
2013-07-02 18:43:46 +02:00
Allan Odgaard
6c2ed2053d Trim version string received from server 2013-07-02 18:43:46 +02:00
Allan Odgaard
dc1a53aa38 Add code for comparing complex version strings 2013-07-02 18:43:46 +02:00
Allan Odgaard
8017428011 If deleting old version fails then move it to trash
We also add a time suffix to the old version so that if we fail to remove it, the user will not get (another) error when retrying the update.

Presumably fixes #991.
2013-05-26 13:32:46 +08:00
Allan Odgaard
b489687403 Disable AuthorizationExecuteWithPrivileges deprecation warning
The “proper” replacement for this API is to use the ServiceManagement framework’s SMJobBless() to bless our helper tool. In two of the three use-cases our helper tool is however regular shell commands, so it seems redundant to wrap these shell tools as helper tools we can install as launchd jobs.
2013-05-06 14:51:31 +07:00
Allan Odgaard
04963caf01 Remove use of deprecated method 2013-04-09 15:39:38 +07:00
Allan Odgaard
b8c81b4acf Fix software updater to not skip checking
Initially ‘downloadWindow’ was a property that was nil until we showed the download window, but now that the download window is re-used for downloading newer versions (incase a newer version appear before user does the “Install & Relaunch”) the fetching the property will return the window (and create it if not already created).
2013-03-28 22:01:40 +01:00