Remove execute permission on file downloaded on a Mac - macos

We have a web app running on a Windows server, which allows a user to do some processing and download the results. The result is a set of files which are dynamically created on the server and zipped into a single file for facilitating the download process.
Everything works fine on Windows, but when users download the file from the web app on a Mac, the contents of the zip file have the execute (chmod +x) permission set (I presume that the same happens on *NIX and Linux machines). This can, of course, be removed by running the 'chmod -x' command, but is there a way by which one can remove the execute permission on the files, so that when downloaded on a Mac, the files don't have the execute permission set by default?

I believe it's not possible - .zip files don't contain permissions, so on a Mac it has to default to "most permissive" (otherwise it's possible that there are applications inside the zip that wouldn't be marked as executable when they need to be).
tars, for instance, do record permissions, but that'd be a bit more difficult to create on a Windows server.

Related

MacOS .app files display and behave like folder in windows explorer

I have a spring boot server hosting a product's file distribution and the product has .exe and .app versions. The .exe file is stored and transmitted without issue but the .app file (created from MacOS and transferred into windows via TeamViewer) is displayed as a folder. The server does not recognize it as a file as well and throws
java.io.FileNotFoundException: source\MyApp.app (Access is denied)
When I create a sample text file and save it as test.app it is treated as a file and not a folder. There is no option to change the folder to a file or method to change it's default opening with explorer. I think it does not care about the .app extension and it treats the .app as file name. I tried to zip it and send to windows but it still doesn't work. See the screenshot for what I mean.
My question is is there any way to change the way windows treats the .app file as a folder? I want it to treat it like a unopenable or raw file.
I solved it by removing the extension and treating it as a normal folder (because .app will not allow Java to read from it and I don't know why). Then I read the contents of the file and made it into a zip archive with the extension 'app' and it works correctly.
I am accepting this as a temporary solution but need to find the cause of this problem.

set execution permission to files deployed from windows to lambda using serverless

I'm using serveless to deploy lambda function, I need to add an executable bin file but when it is uploaded I don't have executable permissions, also I can't change permissions after deployed, the only thing I can do is to move the file to /tmp and there change the permissions, it works ok but adds a lot of overhead because I have to move the files on every Invoke becasue /tmp is ephemeral.
I know there is a known issue that windows&linux files permission are different, so if you zip a file on windows and unzip it on a linux machines you will have problem with permission, especialy with execution, and that happens when serverless deploys the files.
¿Anyone have a better workaround for this? (rather than "deploy from a windows machine")

Silent installation of git through use of .bat file on Windows

I am currently working on a Windows batch file that will allow me to silently install git (the executable for which will be placed in the folder that the .bat file will be running from) in a pre-specified location on the file system.
I've found this article which seems to provide some suitable advice:
https://github.com/msysgit/msysgit/wiki/Silent-or-Unattended-Installation
However, I'm not entirely sure what parameters I would need to mention in my LOADINF file. I would like to pre-define the options that the user would manually select throughout the various stages of installation, so that it can run through from start to finish without prompting anything from the user.
Can anyone help or point me to a place where I can find these parameters and their available values?
Create a file, for eg. my-config.cnf (or my-config.ini) with the following content:
[Setup]
Lang=default
Dir=C:\Program Files (x86)\Git
Group=Git
NoIcons=0
SetupType=default
...
<other options as shown in the msysgit wiki>
Now, in the batch file, when you execute the installation file (say msysgit-install.exe), use /LOADINF as follows:
msysgit-install.exe /SILENT /LOADINF="my-config.cnf"

error when i want to save java file in jdk/bin

when i save java file error is you dont have permission to save in this location contact the administrator to obtain permission on window7
Don't store application data in the "Program Files" directory.
It is very bad design and regular users don't have write access to that directory (for a very good reason).
So even if you changed your settings locally to open up the door for viruses your application won't run on other computers.
Besides: storing a Java file in the JDK directory serves no purpose at all.
Btw: your uppercase letters are broken, as well as the dot or the comma...
That's normal - jdk/bin is the installation directory of the JDK, regular users cannot (and should not) write files there. You'll have the same problem on Linux/Unix and on Mac OS X, where installation directories are off-limits to regular users.
Write your files to the users home directory (System property "user.home", works across platforms), or let the user choose where you save stuff.
Bin directory do not allow directly to save program in it.
it is so simple, just save your .java file on desktop and then copy paste it in Bin. done ;)
If the file can't save directly to c:\program files\java\jdk1.8.0\bin\
Solution:-
Click start Menu type Notepad command in run run as administrator
Right click the Notepad run as Administrator, then type the program file can save directly to c:\program files\java\jdk1.8.0\bin\
Just try it......

How to use .netrc when running MKS Toolkit on Windows?

I am moving an application from Unix (AIX) to Windows. We have MKS Toolkit on the Windows server in order to run our shell scripts fairly unchanged. However, my old FTP jobs depend on the .netrc file. Can anybody tell me whether .netrc is supported under MKS Toolkit, and if yes, where to put the file?
http://www.mkssoftware.com/docs/man4/netrc.4.asp :
The .netrc file is a text file residing in your home directory [...]
http://www.mkssoftware.com/docs/man1/bsdftp.1.asp
If auto-login is enabled, bsdftp checks the .netrc file in the user's home directory [...]

Resources