1. IMPORTANT:
    We launched a new online community and this space is now closed. This community will be available as a read-only resources until further notice.
    JOIN US HERE

How to prevent Native Access from Deleting your downloaded ISO files + Updates (Mac)

Discussion in 'NATIVE ACCESS' started by AphoticD, 5/2/17.

  1. AphoticD

    AphoticD New Member

    Messages:
    3
    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
     
    Last edited: 18/7/17
  2. roderickm

    roderickm New Member

    Messages:
    1
    Thanks for writing this up. The TOC and ISO regexes could benefit from an escaped hyphen. As written, it missed "_nidownload_Session_Guitarist_-_Strummed_Acoustic.toc". It matched with [a-zA-Z0-9_\-].
     
  3. AphoticD

    AphoticD New Member

    Messages:
    3
    Thanks roderickm, I've edited the post to update the command with the escaped hyphen in the expression and tested in the latest version of Native Access.

    I wrote this up earlier in the year and if I hadn't have recorded it, I would never have remembered how I got there. It's a long-winded solution, but I'm glad someone gave it a try!

    Once the initial permissions are set, it's just a matter of keeping the command at step 8 on hand somewhere (like a text file) to paste in when needed. I'm sure someone clever could package this up into a complementing shell script or app.

    -AphoticD
     
  4. raybies

    raybies New Member

    Messages:
    15
    On a PC it's even easier.

    1. Right Click on your NI Downloads folder > Properties > SECURITY tab > ADVANCED button
    2. Click Disable Inheritance
    3. Click "Convert inherited permissions..."
    4. Select the "USERS (COMPUTERNAME\USERS)" group and click edit
    5. Click "Show advanced permissions"
    6. Now you are able to remove the two delete permissions.
     
    • Like Like x 2
  5. Arthur Neeman

    Arthur Neeman NI Product Owner

    Messages:
    92
    Thank you raybies! At last I can catch these 50 installation ISO files and don't worry about reinstalling studio next time. It's almost 70 GB of expansions and will take whole night to redownload them again. It's strange that NI don't allow to relocate expansions as it is for libraries. Like expansions are more serious pieces than libraries.
     
  6. dysamoria

    dysamoria NI Product Owner

    Messages:
    214
    [looks at instructions] Holy CRAP.

    Is there a reason why it can't just be a damned SETTING in Native Access to NOT delete downloads??
     
    • Like Like x 1
  7. Arthur Neeman

    Arthur Neeman NI Product Owner

    Messages:
    92
    I think it's more an anti piracy method.
     
  8. CakeAlexS

    CakeAlexS NI Product Owner

    Messages:
    5.431
    More like anti-user.
     
    • Like Like x 1
  9. dysamoria

    dysamoria NI Product Owner

    Messages:
    214
    It's downloading MY licensed products. How could it POSSIBLY have ANYTHING to do with anti-piracy?
     
  10. Jeezo

    Jeezo NI Product Owner

    Messages:
    184
    And why can t we choose to not install aax format !!
     
  11. tmpc

    tmpc NI Product Owner

    Messages:
    154
    Does this work anymore? I don't see the "USERS (COMPUTERNAME\USERS)". All I have is:
    SYSTEM
    Administrators (computer name\Administrators)
    My user name (my email address)
     
  12. Arthur Neeman

    Arthur Neeman NI Product Owner

    Messages:
    92
    tmpc After you click "Disable Inheritance", doubleclick on each of these three items. In following window click "Show advanced permissions" and then uncheck "Delete subfolders and files" and "Delete". Click on all OK buttons to close all windows.

    I wrote "doubleclick on each" because I don't know who have permission to that folder. Possibly it's Administrators group. But I also don't know who run the process that will try to delete incoming files. So better is to change access for all three subjects.

    After that after all success downloads you will have zip (or whatever) files and aria2__temp files. Probably you will need to save them to your archive/setup device and then delete these files in this downloads folder. For that you will need to go through all the steps and allow full control. Then delete files you don't need in downloads folder.
     
    Last edited: 21/11/20
  13. tmpc

    tmpc NI Product Owner

    Messages:
    154
    Thanks, Arthur. But I came across the easiest way to prevent the deletion of the downloaded ISO file. A person named Bandit on the Audiosex.pro website suggested the following: "Just rename immediately after DL started (so while it appears to download). For example add a 1 behind ('Analog Dream1'). Install will fail, but ISO remains. You don't have to wait, the DL just goes along works. ISO also works" So, you just remove what ever you added to the ISO name, copy the ISO to a safe place, and continue the install with the ISO. Works really well. Plus, the ISO includes both Mac and PC installers.

    EDIT: By the way, while downloading, there are two files in the download location. You should modify the name of the one with the .iso suffix, not the .aria2 file. The .aria2 file is a temporary file that is automatically deleted when the download completes.
     
    Last edited: 9/12/20
    • Like Like x 1
  14. Càno Electrònico

    Càno Electrònico New Member

    Messages:
    1
    Worked for me too, thank you so much!
     
  15. tmpc

    tmpc NI Product Owner

    Messages:
    154
    Cool! I'm glad Bandit's trick worked for you. Let's just hope that NI doesn't "fix" it. ;)
    Happy downloading!