Skip to content

Conversation

@thezim
Copy link
Contributor

@thezim thezim commented Nov 1, 2017

Notable change this time around.

  • Values set by script are "unset" in Info.plist by default to prevent conflicts if a fresh clone.
  • After packaging CFBundleIdentifier is set to random value to prevent it from being picked up by installer. An empty value could not be used because native defaults doesn't allow it.
  • The magic here is getting macOS to recognize the change in the plist file. plutil is enough to make this happen.

Fixes #5262

@TravisEz13
Copy link
Member

Can you go to https://travis-ci.org/profile/thezim?offset=0 and enable your repo then do another push? This will trigger a build with packaging.

@thezim
Copy link
Contributor Author

thezim commented Nov 2, 2017

@TravisEz13 Done.

@TravisEz13
Copy link
Member

Verified packaged correctly here: https://travis-ci.org/thezim/PowerShell/builds/296027725


# Set permissions.
Start-NativeExecution {
find $macosapp | xargs chmod 755
Copy link
Member

@TravisEz13 TravisEz13 Nov 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you undo this when it's finished? Or remove the folder when it's done?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing, good catch, commit added. I realized that 755 wasn't needed for everything so I only set what was absolutely needed and then restore to a default state post fpm.

Copy link
Member

@TravisEz13 TravisEz13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we not leave files with altered permission laying around?

@TravisEz13
Copy link
Member

TravisEz13 commented Nov 3, 2017

packaging built correctly here: https://travis-ci.org/thezim/PowerShell/jobs/296567451

@TravisEz13
Copy link
Member

relaunched AppVeyor due to myget failure..

$newPackagePath = Join-Path $createdPackage.DirectoryName $newPackageName
$createdPackage = Rename-Item $createdPackage.FullName $newPackagePath -PassThru -Force:$Force
}
if($pscmdlet.ShouldProcess("Cleanup macOS launcher"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this cleanup code be moved to the if ($Environment.IsMacOS) block in the finally above?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would agree. Since fpm is in a try, if it fails the next fatal error would be here leaving it in a bad state. I'll go ahead and move it.

As an aside I'm not unsure if the try should even be there for the fpm call. I would think you would want the build point of failure reported at the fpm call and not a dependancy later in the code.

@TravisEz13
Copy link
Member

Packaging build passed here: https://travis-ci.org/thezim/PowerShell/jobs/297030200

@TravisEz13
Copy link
Member

@PowerShell/powershell-maintainers @joeyaiello @SteveL-MSFT Since this previously regressed after working, I would consider this at least moderately risky. Do we want to take this for 6.0.0?
I think we should. I believe we have addressed the issues (thanks @thezim) and we shipped the last beta with this feature.

@thezim
Copy link
Contributor Author

thezim commented Nov 4, 2017

We should ensure if #5323 merges first that we include the UTI update to CFBundleIdentifier in the plist in this PR.

@TravisEz13 TravisEz13 changed the title Enable macOS launcher [Don't Merge] Enable macOS launcher Nov 5, 2017
@TravisEz13
Copy link
Member

#5323 was merged. I updated the title so we don't accidentally merge until the PR is updated.

@thezim
Copy link
Contributor Author

thezim commented Nov 5, 2017

UTI updated. Packaging build passed.

@TravisEz13 TravisEz13 changed the title [Don't Merge] Enable macOS launcher Enable macOS launcher Nov 6, 2017
@daxian-dbw
Copy link
Member

@TravisEz13 I agree that we should take this fix for 6.0.0, since the beta.9 macOS package already had the macOS launcher change.

Copy link
Member

@adityapatwardhan adityapatwardhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree we should take this change.

@TravisEz13 TravisEz13 merged commit a674c51 into PowerShell:master Nov 6, 2017
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

Successfully merging this pull request may close these issues.

4 participants