Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- https://www.native-instruments.com/forum/threads/how-to-prevent-native-access-from-deleting-your-downloaded-iso-files-updates-mac.314112/
- INTRODUCTION:
- For the most part, Native Access seamlessly downloads and installs NI software (including updates). The software then safely deletes the downloaded files to free up storage space. For most users this works well, but many like myself, would like to keep the .iso and .dmg files safe for reinstallation or for installing on a second workstation (e.g. Install everything on a Mac Pro in the studio and then replicate the installation on a MacBook Pro for portability).
- The inability to keep installer files is inconvenient as it is time consuming (and uneconomic) to download multiple gigabytes of software more than once.
- A SOLUTION:
- This solution simply allows the Native Access app to create new files, but prevents it from deleting what it downloads. We then manually intervene by putting the downloads into place before they are installed.
- Here is how I approached it;
- 1. Open Terminal (/Applications/Utilities/Terminal.app).
- 2. Enter these commands (one line at a time) - you can copy and paste to prevent any typos;
- mkdir ~/NI\ Downloads
- sudo chown root:admin ~/NI\ Downloads
- sudo chmod +a "admin deny delete,file_inherit,directory_inherit,limit_inherit" ~/NI\ Downloads
- sudo chmod +a "admin allow list,add_subdirectory,add_file,file_inherit,directory_inherit,limit_inherit" ~/NI\ Downloads
- touch ~/NI\ Downloads/_nidownload.tmp
- (type your password when requested)
- We've created a new folder specifically for Native Instruments downloads and a blank "_nidownload.tmp" file to act as a road block to stop Native Access from moving files out of their temp folders once downloaded.
- 3. In Native Access, go to Preferences from the user profile symbol at the top right of the window.
- 4. Set the "Download Location" to the new "NI Downloads" folder you've just created in your home directory.
- 5. Return to Native Access and click "Install All" to start downloading your software.
- 6. Patiently wait for your downloads to finish. In my case, this took two days to download 30GB+. As each download completes, Native Access will attempt to install the software and then report that the installation has "FAILED". This is expected behaviour as we have limited the software's rights within the new downloads folder and it doesn't understand why it's not working the way it expects.
- 7. Return to the Terminal and traverse into the NI Downloads folder;
- cd NI\ Downloads
- 8. Now copy and paste all (7) lines of this command into the Terminal and hit Enter;
- TYPE=iso START=head PFX='_nidownload' \
- && HASH=`du -sh * | grep -v -e \ 'K\t' -e 'B\t' | grep -o \
- "$PFX\_[0-9a-z]\{1,\}" | sed "s/$PFX\_//g" | $START -n 1` \
- && TOC=`grep $HASH *.toc | grep md5 | grep -o \
- "^$PFX\_[a-zA-Z0-9_\-]\{1,\}.toc"` && ISO=`grep -o \
- '[a-zA-Z0-9_\-]\{1,\}.'$TYPE $TOC | $START -n 1` \
- && mv -v $PFX\_$HASH/$PFX.tmp ./$ISO && chmod a-w $ISO
- (Note: Command edited and tested 18th July 2017 12:20pm AEST)
- (Tested with Native Access v1.2.0.53)
- IMPORTANT: When applying this method to Software Updates (and not first time installations), change "TYPE=iso" to "TYPE=dmg" at the beginning of the command. Native Access typically use ".iso" format for new software and ".dmg" format for updates.
- This command will read the associated ".iso" (or ".dmg") filename from within a ".toc" file based on the md5 hash from the temp folder name. It will then rename the associated ".tmp" file accordingly and attempt to further lock down the newly named ".iso" (or ".dmg") file to prevent deletion.
- If something blocks the command from successfully renaming/moving a file, try starting at the bottom of the download list and working backward by changing "START=head" to "START=tail" in the first line of the command.
- 9. Repeat the command (press Up arrow, then Enter again) until all of the .iso (or .dmg) files are in place. You may see the command waiting for further input (doing nothing) if there are no more files to process. Just press Ctrl-C to cancel if you don't see your command prompt.
- 10. It is now safe to return to Native Access and hit the "Install All" button again. The software will go through and install from all of the .iso (and .dmg) files you named, but it won't be able to delete them.
- 11. Quit Native Access.
- 12. You can safely move all of the empty _nidownload_X folders to the Trash. Keep the .toc files together with the .iso (and .dmg) files so that Native Access can connect the dots when installing on a new Mac.
- 13. *** Make a backup of your NI Downloads folder! ***
- If you run into any trouble and want to strip all of the special permissions we've set then return to Terminal and enter;
- sudo chmod -R -N ~/NI\ Downloads
- sudo chown <username> ~/NI\ Downloads
- chmod -R u+w ~/NI\ Downloads
- Change <username> to your shortname e.g seymourjohns - use the command 'whoami' if you lose track of your identity.
- I hope people will find this information useful.
- -AphoticD
Advertisement
Add Comment
Please, Sign In to add comment