How do you check what files are inside an NSIS setup.exe? - nsis

In my NSIS script, I use this line:
File "..\help\*.*"
My problem is that I have the help directory in my subversion repository (its constantly updated as we add new functionality). This means that the help directory contains a .svn directory.
I wish to view the contents of the setup.exe that NSIS created to verify that it does not have the .svn directory.
P.s. I experimented to see if NSIS recursively adds files when wildcards are used. It doesn't. But I want to verify this, hence the question.

These things are typically compressed files.
You could check with 7z/7-zip to open the EXE archive.
As a record, after the comments below,
I'd like to point to my recent notes on the merits of 7-zip at Superuser,
Compressing with RAR vs ZIP

Rather than look at what's in your NSIS exe itself, just exclude the .svn directories so you know they'll never be in there.
Something like this will do the trick:
File /r /x .svn "..\help\*.*"
The /x .svn bit tells NSIS to exclude those directories.
Coincidentally, if you're not using the /r switch, then you're not adding files and folders recursively, so it wouldn't add the .svn subdirectories anyway.

Instead of unzipping, my suggestion is to look at the NSIS compilation log. It will tell you everything about files included. When doing changes in my NSIS scripts I always check the logs to make sure that everything is going according to plan. Streaming the log from the command line to a text file, then read it from your favorite editor.

I use 7zip File Manager and the "Open Inside" command.

Related

How to move all files to subdirectories by extension name in the specified DIR directory?

How to move all files (except directories) to subdirectories by extension name in the specified DIR directory?
If I'm understanding your question correctly, globbing should help you. If you're going to be using linux for a while, I'd recommend reading up on it, as it makes using linux and bash much easier.
To directly answer your question, something like this should work:
mv *.<extension> <target directory>

How to use command zip in linux that folder have short path?

I used command zip in linux (RedHat), this is my command:
zip -r /home/username/folder/compress/zip.zip /home/username/folder/compressed/*
Then, i open file zip.zip, i see architecture as path folder compress.
I want to in folder zip only consist list file *.txt
Because i used this command in script crontab hence i can't use command cd to path folder before run command zip
Please help me
I skimmed the zip man page and this is what I have found. There is not an option archive files relative to a different directory. The closest I have found is zip -j which removes the entire path and stores the files directly in the zip rather than sub directories. I do not know what happens in the case of file name conflicts such as if /home/username/folder/compressed/a.txt and /home/username/folder/compressed/subdir/a.txt both exist. If this is not a problem for you, you can use this option, but I am concerned because you did specify the -r option indicating that you expect zip to traverse sub folders.
I also thought of the possibility that your script could somehow call zip with a different working directory, but I took a look at this unix stack exchange page and it looks like their options use cd.
I have to admit I do not understand why you cannot use cd and I am very curious about it. You said something about using crontab, but I have never heard of anything wrong with changing directories in a crontab script.
I used option -j in command zip
zip -jr /home/username/folder/compress/zip.zip /home/username/folder/compressed/*
and i was yet settled this problem, thanks

is it possible to put comments in a directory about a dir or file?

is it possible to put comments in a directory about a dir or file locally on my own machine, appearing in my terminal. I don't have any kind of GUI, so this would be helpful.
Maybe something like, when I do ls -l I will see:
file.txt #this is that file I made on tuesday
files #this is the directory I made with all those other files
If so, what is the tool to do it?
Is it available for Arch Linux?
Yes, there is a tool for that. It is called GIT or SVN.

Sublime is "touching" files from back-directory

When I update a file on sublime in any folder, it touch all files in back directory with same basename of this directory when atomic_save is active. For instance, if I have:
/default/file.txt
/default.txt
/default.css
/file.txt
If I edit /default/file.txt, Sublime will touch too /default.txt and /default.css, but not /file.txt.
Why it happen? I'm using chokidor with node and it is get a lot of file changes, when I only save one file.
Maybe not is the best answer. But I cached the initial fs.Stat of each watched file, and when it is "touched" I compare the mtime. For this case specific it works to me (possibly an issue on chokidar).

Can you use tar to apply a patch to an existing web application?

Patches are frequently released for my CMS system. I want to be able to extract the tar file containing the patched files for the latest version directly over the full version on my development system. When I extract a tar file it puts it into a folder with the name of the tar file. That leaves me to manually copy each file over to the main directory. Is there a way to force the tar to extract the files into the current directory and overwrite any files that have the same filenames? Any directories that already exist should not be overwritten, but merged...
Is this possible? If so, what is the command?
Check out the --strip-components (or --strippath) argument to tar, might be what you're looking for.
EDIT: you might want to throw --keep-newer into the mix, so any locally modified files aren't overwritten. And I would suggest testing new releases on a development server, then using rsync or subversion to carry over the changes.
I tried getting --strip-components to work and, while I didn't try that hard, I didn't get it working. It kept flattening the directory structure. In searching, I came across the following command that seems to do exactly what I want:
pax -r -f patch.tar -s'/patch///'
It's not tar, but hey, it works... Replace the words "patch" with whatever your tar file name is.
The option '--strip-components' allows you to trim parts of the embedded filenames. With that it is possible to do what you want.
For more help check out http://www.gnu.org/software/tar/manual/html_section/transform.html
I have just done:
tar -xzf patch.tar.gz
And it overwrites all the files that the patch contains.
I.e., if the patch was created for the contents of the app folder, I would extract it there. Results would be like this:
tar.gz contains: oldfolder/someoldfile.txt, oldfolder/newfolder/newfile.txt
before app looks like:
app/oldfolder/someoldfile.txt
Afterwards, app looks like
app/oldfolder/someoldfile.txt
oldfolder/newfolder/newfile.txt
And the "someoldfile.txt" is actually updated to what was in the tar.gz
Maybe this doesn't work with regular tar, only tar.gz. But I doubt it. I think it should work for everything, as long as user has write permissions.

Resources