HISE Logo Forum
    • Categories
    • Register
    • Login

    Windows Folder Permissions

    Scheduled Pinned Locked Moved General Questions
    22 Posts 3 Posters 752 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • DanHD
      DanH
      last edited by DanH

      I'm using a script to check folder permissions before downloading a file. This works fine on OSX but not on Windows. The script should display a warning if there are no write permissions in the destination folder, but on windows it skips that part, displays nothing and the file is not downloaded. Code below. @d-healey I think you're using this function too - are you having success on Windows with it?

      inline function startDownload()
      {	
      	Engine.showYesNoWindow("SELECT FOLDER", "SELECT WHERE YOU WANT TO STORE THE SAMPLES", function(response)
      	{
      		
      		if (response)
      		{
      
      			FileSystem.browseForDirectory(downloadsFolder, function(dir)
      			{
      				if (isDefined(dir) && dir.isDirectory())
      				{
      	
      					if (dir.hasWriteAccess())
      					{
      						Server.setBaseURL("https://linkylink.com");
      						
      						var f = dir.getChildFile("SAMPLES.zip");
      						
      						if(f.isFile())
      						{
      							f.deleteFileOrDirectory();
      							download = Server.downloadFile(url, {}, f, downloadCallback);
      						
      						}
      						
      						else
      						{
      							download = Server.downloadFile(url, {}, f, downloadCallback);	
      						}
      						
      
      					}
      
      					else
      					{
      						Label1.set("text", "PERMISSIONS ERROR!");
      
      					}	
      					
      					d = dir; 	
      				}		
      			});
      		}
      
      	});
      }
      

      DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
      https://dhplugins.com/ | https://dcbreaks.com/
      London, UK

      1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey
        last edited by

        This is what I'm doing

        		if (isDefined(dir) && dir.isDirectory())
        		{
        			if (!dir.hasWriteAccess())
        				return MessageHandler.showMessage("Unwritable Directory", "You do not have write permission for the selected directory. Please choose a different one.", 1);
        

        Libre Wave - Freedom respecting instruments and effects
        My Patreon - HISE tutorials
        YouTube Channel - Public HISE tutorials

        d.healeyD 1 Reply Last reply Reply Quote 1
        • d.healeyD
          d.healey @d.healey
          last edited by

          @DanH Not sure I ever tested this in Windows BTW, so it's possible it doesn't work there.

          Libre Wave - Freedom respecting instruments and effects
          My Patreon - HISE tutorials
          YouTube Channel - Public HISE tutorials

          DanHD 1 Reply Last reply Reply Quote 0
          • DanHD
            DanH @d.healey
            last edited by

            @d-healey yes, annoyingly it doesn't!

            DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
            https://dhplugins.com/ | https://dcbreaks.com/
            London, UK

            d.healeyD 1 Reply Last reply Reply Quote 0
            • d.healeyD
              d.healey @DanH
              last edited by

              @DanH Very easy way to test it.

              const dir = FileSystem.getFolder(FileSystem.Downloads);
              
              Console.print(dir.hasWriteAccess()); // If you get a 1 it works.
              

              Libre Wave - Freedom respecting instruments and effects
              My Patreon - HISE tutorials
              YouTube Channel - Public HISE tutorials

              DanHD 1 Reply Last reply Reply Quote 0
              • DanHD
                DanH @d.healey
                last edited by

                @d-healey looks like I've been here before 😆
                https://forum.hise.audio/topic/6404/downloading-permissions/5?_=1671616793197

                DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                https://dhplugins.com/ | https://dcbreaks.com/
                London, UK

                d.healeyD 1 Reply Last reply Reply Quote 0
                • d.healeyD
                  d.healey @DanH
                  last edited by

                  @DanH Did you try the test script above? Are you sure you have write permission for the directory you're selecting?

                  Libre Wave - Freedom respecting instruments and effects
                  My Patreon - HISE tutorials
                  YouTube Channel - Public HISE tutorials

                  DanHD 1 Reply Last reply Reply Quote 0
                  • DanHD
                    DanH @d.healey
                    last edited by

                    @d-healey not yet I'm exporting right now. But I'm trying to save into a folder that I don't have permissions for in order to execute my error dialogue so the user know's what's going on.

                    DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                    https://dhplugins.com/ | https://dcbreaks.com/
                    London, UK

                    LindonL DanHD 2 Replies Last reply Reply Quote 0
                    • LindonL
                      Lindon @DanH
                      last edited by Lindon

                      @DanH said in Windows Folder Permissions:

                      @d-healey not yet I'm exporting right now. But I'm trying to save into a folder that I don't have permissions for in order to execute my error dialogue so the user know's what's going on.

                      make sure you are NOT running as an Admin then....as you will have a lot of permissions by default if you are.

                      HISE Development for hire.
                      www.channelrobot.com

                      1 Reply Last reply Reply Quote 1
                      • DanHD
                        DanH @DanH
                        last edited by DanH

                        @Lindon I've created a special folder with no permissions at all to test with. Doesn't matter if I'm admin or not. The point is that the script doesn't run the 'else' command after checking permissions.

                        I just rechecked the Admin Permissions box in the project settings again and now when I open my standalone app I get the generic windows User Account Control message which is interesting (Do you want to allow this app from an unknown publisher to make changes to your device?). It still doesn't solve the permissions script, however.

                        As my other thread details if you double click on the folder you are trying to save to (in the Windows save to dialogue) it will display a permissions error (made by @Christoph-Hart I assume). However I assume like me most people will click once on the folder and then click 'Select Folder' button (in the Windows browser I mean).

                        Would be great if this permissions error would show after hitting the 'Select Folder' button as well.

                        DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                        https://dhplugins.com/ | https://dcbreaks.com/
                        London, UK

                        d.healeyD 1 Reply Last reply Reply Quote 0
                        • d.healeyD
                          d.healey @DanH
                          last edited by

                          @DanH Yep I can confirm this issue. But it's not a HISE issue, it's a JUCE issue, and an old one - https://forum.juce.com/t/file-haswriteaccess-does-not-check-permissions/31340

                          Libre Wave - Freedom respecting instruments and effects
                          My Patreon - HISE tutorials
                          YouTube Channel - Public HISE tutorials

                          DanHD 1 Reply Last reply Reply Quote 0
                          • DanHD
                            DanH @d.healey
                            last edited by

                            @d-healey but it does work if you double click on the folder...

                            DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                            https://dhplugins.com/ | https://dcbreaks.com/
                            London, UK

                            d.healeyD 1 Reply Last reply Reply Quote 0
                            • d.healeyD
                              d.healey @DanH
                              last edited by

                              @DanH Yes, but that's unrelated to JUCE.

                              Libre Wave - Freedom respecting instruments and effects
                              My Patreon - HISE tutorials
                              YouTube Channel - Public HISE tutorials

                              DanHD 1 Reply Last reply Reply Quote 0
                              • DanHD
                                DanH @d.healey
                                last edited by

                                @d-healey you think that's a Windows message?

                                DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                                https://dhplugins.com/ | https://dcbreaks.com/
                                London, UK

                                d.healeyD 1 Reply Last reply Reply Quote 0
                                • d.healeyD
                                  d.healey @DanH
                                  last edited by

                                  @DanH Show me a screenshot please so I know we're talking about the same thing.

                                  Libre Wave - Freedom respecting instruments and effects
                                  My Patreon - HISE tutorials
                                  YouTube Channel - Public HISE tutorials

                                  DanHD 1 Reply Last reply Reply Quote 0
                                  • DanHD
                                    DanH @d.healey
                                    last edited by

                                    @d-healey how does one screenshot windows?

                                    DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                                    https://dhplugins.com/ | https://dcbreaks.com/
                                    London, UK

                                    d.healeyD 1 Reply Last reply Reply Quote 0
                                    • d.healeyD
                                      d.healey @DanH
                                      last edited by d.healey

                                      @DanH Press the Prnt Scrn button on your keyboard or use the Snipping Tool.

                                      Libre Wave - Freedom respecting instruments and effects
                                      My Patreon - HISE tutorials
                                      YouTube Channel - Public HISE tutorials

                                      DanHD 1 Reply Last reply Reply Quote 0
                                      • DanHD
                                        DanH @d.healey
                                        last edited by

                                        @d-healey had to take a photo in the end 😆

                                        IMG_8687.jpg

                                        DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                                        https://dhplugins.com/ | https://dcbreaks.com/
                                        London, UK

                                        d.healeyD 1 Reply Last reply Reply Quote 0
                                        • d.healeyD
                                          d.healey @DanH
                                          last edited by

                                          @DanH Yeah that's a Window's message from Explorer.

                                          Libre Wave - Freedom respecting instruments and effects
                                          My Patreon - HISE tutorials
                                          YouTube Channel - Public HISE tutorials

                                          DanHD 2 Replies Last reply Reply Quote 0
                                          • DanHD
                                            DanH @d.healey
                                            last edited by

                                            @d-healey ok, thanks!

                                            DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                                            https://dhplugins.com/ | https://dcbreaks.com/
                                            London, UK

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            55

                                            Online

                                            1.7k

                                            Users

                                            11.7k

                                            Topics

                                            102.2k

                                            Posts