Skip to content
This repository has been archived by the owner on Nov 10, 2019. It is now read-only.

Commit

Permalink
Desktop
Browse files Browse the repository at this point in the history
for #122
  • Loading branch information
macmule committed Mar 3, 2019
1 parent e1cf48e commit 04c0e14
Show file tree
Hide file tree
Showing 8 changed files with 141 additions and 68 deletions.
Binary file modified .DS_Store
Binary file not shown.
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@

.DS_Store

.DS_Store
*.DS_Store
*.xcuserstate
7 changes: 7 additions & 0 deletions AutoCasperNBI.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
7C1305A5193FC10A0060F343 /* osx-jss-login.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "osx-jss-login.png"; sourceTree = "<group>"; };
7C1305A6193FC10A0060F343 /* RemoteDesktop.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = RemoteDesktop.icns; sourceTree = "<group>"; };
7C1305A7193FC10A0060F343 /* ToolbarDesktopFolderIcon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = ToolbarDesktopFolderIcon.icns; sourceTree = "<group>"; };
7C1726BA21AC798400D07797 /* AutoCasperNBI.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = AutoCasperNBI.entitlements; sourceTree = "<group>"; };
7C197009198058F00092062D /* Scripts.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Scripts.icns; sourceTree = "<group>"; };
7C19733E21766DA100282107 /* com.AutoCasperNBI.JamfImaging.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = com.AutoCasperNBI.JamfImaging.plist; sourceTree = "<group>"; };
7C23C473195A3AEB00FAC70A /* Screensharing.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Screensharing.icns; sourceTree = "<group>"; };
Expand Down Expand Up @@ -187,6 +188,7 @@
7C130586193FC0B60060F343 /* AutoCasperNBI */ = {
isa = PBXGroup;
children = (
7C1726BA21AC798400D07797 /* AutoCasperNBI.entitlements */,
7C19733E21766DA100282107 /* com.AutoCasperNBI.JamfImaging.plist */,
7C3759481BC7027900CBB857 /* 10.11NBImageInfo */,
7CB60993199189E20068574D /* root.plist */,
Expand Down Expand Up @@ -290,6 +292,11 @@
7C13057A193FC0B60060F343 = {
DevelopmentTeam = 7WHVYYF52U;
ProvisioningStyle = Automatic;
SystemCapabilities = {
com.apple.HardenedRuntime = {
enabled = 0;
};
};
};
};
};
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "AutoCasperNBI/AutoCasperNBIAppDelegate.applescript"
timestampString = "561588626.058836"
timestampString = "573264265.9506609"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "4877"
endingLineNumber = "4877"
landmarkName = "unknown"
landmarkType = "0">
startingLineNumber = "4905"
endingLineNumber = "4905"
landmarkName = "on updateNBImageInfoPlist_(sender)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
Expand Down
6 changes: 3 additions & 3 deletions AutoCasperNBI/AutoCasperNBI-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.5.0</string>
<string>1.5.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>147</string>
<string>158</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2018 macmule. All rights reserved.</string>
<string>Copyright © 2019 macmule. All rights reserved.</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
Expand Down
5 changes: 5 additions & 0 deletions AutoCasperNBI/AutoCasperNBI.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
</plist>
175 changes: 119 additions & 56 deletions AutoCasperNBI/AutoCasperNBIAppDelegate.applescript
Original file line number Diff line number Diff line change
Expand Up @@ -2472,18 +2472,45 @@ script AutoCasperNBIAppDelegate
--Log Action
set logMe to "Emptied " & netBootDmgMountPath & "/System/Library/Compositions/"
logToFile_(me)
-- Update Build Process Window's Text Field
set my buildProcessTextField to "/System/Library/CoreServices/DefaultDesktop.jpg"
delay 0.1
try
-- Remove DefaultDesktop.jpg's symbolic link, silently error is doesn't exist
do shell script "unlink " & quoted form of netBootDmgMountPath & "/System/Library/CoreServices/DefaultDesktop.jpg" user name adminUserName password adminUsersPassword with administrator privileges
-- Delete DefaultDesktop.jpg
do shell script "/bin/rm -rf " & quoted form of netBootDmgMountPath & "/System/Library/CoreServices/DefaultDesktop.jpg" user name adminUserName password adminUsersPassword with administrator privileges
end try
--Log Action
set logMe to "Deleted " & netBootDmgMountPath & "/System/Library/CoreServices/DefaultDesktop.jpg"
logToFile_(me)
if selectedOSdmgVersionMajor is less than 14 then
-- Update Build Process Window's Text Field
set my buildProcessTextField to "/System/Library/CoreServices/DefaultDesktop.jpg"
delay 0.1
try
-- Remove DefaultDesktop.jpg's symbolic link, silently error is doesn't exist
do shell script "/bin/unlink " & quoted form of netBootDmgMountPath & "/System/Library/CoreServices/DefaultDesktop.jpg" user name adminUserName password adminUsersPassword with administrator privileges
-- Delete DefaultDesktop.jpg
do shell script "/bin/rm -rf " & quoted form of netBootDmgMountPath & "/System/Library/CoreServices/DefaultDesktop.jpg" user name adminUserName password adminUsersPassword with administrator privileges
end try
--Log Action
set logMe to "Deleted " & netBootDmgMountPath & "/System/Library/CoreServices/DefaultDesktop.jpg"
logToFile_(me)
else
-- Update Build Process Window's Text Field
set my buildProcessTextField to "/System/Library/CoreServices/DefaultBackground.jpg"
delay 0.1
try
-- Remove DefaultDesktop.jpg's symbolic link, silently error is doesn't exist
do shell script "/bin/unlink " & quoted form of netBootDmgMountPath & "/System/Library/CoreServices/DefaultBackground.jpg" user name adminUserName password adminUsersPassword with administrator privileges
-- Delete DefaultDesktop.jpg
do shell script "/bin/rm -rf " & quoted form of netBootDmgMountPath & "/System/Library/CoreServices/DefaultBackground.jpg" user name adminUserName password adminUsersPassword with administrator privileges
end try
--Log Action
set logMe to "Deleted " & netBootDmgMountPath & "/System/Library/CoreServices/DefaultBackground.jpg"
logToFile_(me)
-- Update Build Process Window's Text Field
set my buildProcessTextField to "/System/Library/CoreServices/DefaultDesktop.heic"
delay 0.1
try
-- Remove DefaultDesktop.jpg's symbolic link, silently error is doesn't exist
do shell script "/bin/unlink " & quoted form of netBootDmgMountPath & "/System/Library/CoreServices/DefaultDesktop.heic" user name adminUserName password adminUsersPassword with administrator privileges
-- Delete DefaultDesktop.jpg
do shell script "/bin/rm -rf " & quoted form of netBootDmgMountPath & "/System/Library/CoreServices/DefaultDesktop.heic" user name adminUserName password adminUsersPassword with administrator privileges
end try
--Log Action
set logMe to "Deleted " & netBootDmgMountPath & "/System/Library/CoreServices/DefaultDesktop.heic"
logToFile_(me)
end if
-- Update Build Process Window's Text Field
set my buildProcessTextField to "Emptying /System/Library/LinguisticData/"
delay 0.1
Expand Down Expand Up @@ -3607,52 +3634,88 @@ script AutoCasperNBIAppDelegate
on copyDesktopImage_(sender)
-- If we have a desktop selected & we can find it
if desktopImageExists is true
try
-- Update Build Process Window's Text Field
set my buildProcessTextField to "Copying Desktop Image"
delay 0.1
-- Update build Process ProgressBar
set my buildProcessProgressBar to buildProcessProgressBar + 1
-- Set variableVariable to path of DefaultDesktop.jpg
set variableVariable to netBootDmgMountPath & "/System/Library/CoreServices/DefaultDesktop.jpg"
--Log Action
set logMe to "Removing symbolic link on " & netBootDmgMountPath & "/System/Library/CoreServices/DefaultDesktop.jpg"
logToFile_(me)
try
-- Remove DefaultDesktop.jpg's symbolic link, silently error is doesn't exist
do shell script "unlink " & quoted form of netBootDmgMountPath & "/System/Library/CoreServices/DefaultDesktop.jpg" user name adminUserName password adminUsersPassword with administrator privileges
end try
if selectedOSdmgVersionMajor is less than 14 then
-- Set to text
set customDesktopImagePath to customDesktopImagePath as text
--Log Action
set logMe to "Trying to copy " & customDesktopImagePath & " to " & netBootDmgMountPath & "/System/Library/CoreServices/DefaultDesktop.jpg"
logToFile_(me)
-- Copy selected image
do shell script "/bin/cp -r " & quoted form of customDesktopImagePath & " " & quoted form of netBootDmgMountPath & "/System/Library/CoreServices/DefaultDesktop.jpg" user name adminUserName password adminUsersPassword with administrator privileges
--Log Action
set logMe to "Copied " & customDesktopImagePath & " to " & netBootDmgMountPath & "/System/Library/CoreServices/DefaultDesktop.jpg"
logToFile_(me)
--Log Action
set logMe to "Trying to set permissions to 755 on " & quoted form of netBootDmgMountPath & "/System/Library/CoreServices/DefaultDesktop.jpg"
logToFile_(me)
-- Making writable
do shell script "/bin/chmod -R 755 " & quoted form of netBootDmgMountPath & "/System/Library/CoreServices/DefaultDesktop.jpg" user name adminUserName password adminUsersPassword with administrator privileges
--Log Action
set logMe to "Set permissions to 755 on " & quoted form of netBootDmgMountPath & "/System/Library/CoreServices/DefaultDesktop.jpg"
logToFile_(me)
-- Copy Casper Imaging.app selected earlier
copyCasperImagingApp_(me)
on error
--Log Action
set logMe to "Error: Copying Desktop Image"
logToFile_(me)
-- Set to false to display
set my userNotifyErrorHidden to false
-- Set Error message
set my userNotifyError to "Error: Copying Desktop Image"
-- Notify of errors or success
userNotify_(me)
end try
try
-- Update Build Process Window's Text Field
set my buildProcessTextField to "Copying Desktop Image"
delay 0.1
-- Update build Process ProgressBar
set my buildProcessProgressBar to buildProcessProgressBar + 1
--Log Action
set logMe to "Removing symbolic link on " & netBootDmgMountPath & "/System/Library/CoreServices/DefaultDesktop.jpg"
logToFile_(me)
try
-- Remove DefaultDesktop.jpg's symbolic link, silently error is doesn't exist
do shell script "/bin/unlink " & quoted form of netBootDmgMountPath & "/System/Library/CoreServices/DefaultDesktop.jpg" user name adminUserName password adminUsersPassword with administrator privileges
end try
--Log Action
set logMe to "Trying to copy " & customDesktopImagePath & " to " & netBootDmgMountPath & "/System/Library/CoreServices/DefaultDesktop.jpg"
logToFile_(me)
-- Copy selected image
do shell script "/bin/cp -r " & quoted form of customDesktopImagePath & " " & quoted form of netBootDmgMountPath & "/System/Library/CoreServices/DefaultDesktop.jpg" user name adminUserName password adminUsersPassword with administrator privileges
--Log Action
set logMe to "Copied " & customDesktopImagePath & " to " & netBootDmgMountPath & "/System/Library/CoreServices/DefaultDesktop.jpg"
logToFile_(me)
--Log Action
set logMe to "Trying to set permissions to 755 on " & quoted form of netBootDmgMountPath & "/System/Library/CoreServices/DefaultDesktop.jpg"
logToFile_(me)
-- Making writable
do shell script "/bin/chmod -R 755 " & quoted form of netBootDmgMountPath & "/System/Library/CoreServices/DefaultDesktop.jpg" user name adminUserName password adminUsersPassword with administrator privileges
--Log Action
set logMe to "Set permissions to 755 on " & quoted form of netBootDmgMountPath & "/System/Library/CoreServices/DefaultDesktop.jpg"
logToFile_(me)
-- Copy Casper Imaging.app selected earlier
copyCasperImagingApp_(me)
on error
--Log Action
set logMe to "Error: Copying Desktop Image"
logToFile_(me)
-- Set to false to display
set my userNotifyErrorHidden to false
-- Set Error message
set my userNotifyError to "Error: Copying Desktop Image"
-- Notify of errors or success
userNotify_(me)
end try
else
try
-- Update Build Process Window's Text Field
set my buildProcessTextField to "Copying Desktop Image"
delay 0.1
-- Update build Process ProgressBar
set my buildProcessProgressBar to buildProcessProgressBar + 1
--Log Action
set logMe to "Trying to copy " & customDesktopImagePath & " to " & netBootDmgMountPath & "/Library/Desktop Pictures/Mojave.heic"
logToFile_(me)
-- Copy selected image
do shell script "/bin/cp -r " & quoted form of customDesktopImagePath & " " & quoted form of netBootDmgMountPath & "/Library/Desktop\\ Pictures/Mojave.heic" user name adminUserName password adminUsersPassword with administrator privileges
--Log Action
set logMe to "Copied " & customDesktopImagePath & " to " & netBootDmgMountPath & "/Library/Desktop Pictures/Mojave.heic"
logToFile_(me)
--Log Action
set logMe to "Trying to set permissions to 755 on " & quoted form of netBootDmgMountPath & "/Library/Desktop Pictures/Mojave.heic"
logToFile_(me)
-- Making writable
do shell script "/bin/chmod -R 755 " & quoted form of netBootDmgMountPath & "/Library/Desktop\\ Pictures/Mojave.heic" user name adminUserName password adminUsersPassword with administrator privileges
--Log Action
set logMe to "Set permissions to 755 on " & quoted form of netBootDmgMountPath & "/Library/Desktop Pictures/Mojave.heic"
logToFile_(me)
-- Copy Casper Imaging.app selected earlier
copyCasperImagingApp_(me)
on error
--Log Action
set logMe to "Error: Copying Desktop Image"
logToFile_(me)
-- Set to false to display
set my userNotifyErrorHidden to false
-- Set Error message
set my userNotifyError to "Error: Copying Desktop Image"
-- Notify of errors or success
userNotify_(me)
end try
end if
else
-- Copy Casper Imaging.app selected earlier
copyCasperImagingApp_(me)
Expand Down

0 comments on commit 04c0e14

Please sign in to comment.