NSIS reading an unicode file name issue - unicode

I am trying to add a file with unicode name to my installer , when I copy and paste or insert the filename , it gives ??????.pdf as characters, so in compilation it couldn't recognise the file and failed to open it .
File: failed opening file "..\???? ????????.pdf"
Any idea will be appreciated

With NSIS 2 all filenames have to be encoded in the active codepage (CP_ACP) and it will generate an ANSI API installer so the codepage on the end-users machine comes into play as well.
The NSIS 3 compiler is Unicode but to generate a Unicode installer you need to add Unicode true to your .nsi script.

Do you use the standard NSIS version (2.46)?
Maybe you can try the Unicode NSIS or the new (alpha!) Version NSIS 3.0a2.

Related

Strange behavior of some zip files while extracting (7zip)

I have a problem with unzipping files. Usually I use a PowerShell script, that I run through SQL Server database (procedure) and it will unzip my files how I want them (database shouldn't be any issue).
Main part of script:
exec '"for %i in ("'+#path+'\*.zip") do "C:\Program Files\7-Zip\7z.exe" x "%i" -o"'+#to+'""'
But for once in a while there is a .zip file that if run through this script will extract files with names of files encoded badly and to prevent that I need to manually open every .zip file and click to extract in 7-zip GUI and that will returns names of files correctly.
This manual way of doing things very, very slow. Because it needs to be done on a server, God forbids if I am on VPN at home. So let's say I have 5 zip files (3 GB), it will take me hours to unzip. If I do it, through server it takes like 2 minutes.
So I just trying to find out how to unzip it with script, what is the difference between my script and manual extraction?
The root-cause is likely to be files that were created with a setup that doesn't match the codepage of your windows environment. Are any of the zip file publicly available? If so, can you provide a link?
To deal with these problem files, you need to know what encoding was used for the filenames. If the 7z gui can handle these files automatically there must be an option to tell it what encoding to use.
Once you know the encoding you can use the -scs option in 7z to decode the filenames correctly.
Modern zip files don't have this issue because they store filenames in UTF-8.

install4j: Extract application JARs from a Windows installer

We are looking for an approach to extract our application JARs and resources from an EXE installer built with install4j. We are trying to automate installers testing though without actual installation - we want to run our application main JAR unpacked from an installer.
With help of PE file format parser https://github.com/kichik/pecoff4j I've found the major part of content is placed in some kind of preamble of an image. The same entry with the same size is shown when I opened the installer in 7-Zip:
But the format of the entry is unknown to 7-Zip and I can't to go deeper. When I opened the entry in a hex editor I found some of the application resources content, classes names, etc.
The question is - what is a format of the entry and how can I parse it?
P.S.: It seems there should be no issues with DMG for Apple and SH for Linux - as they are regular archives and I hope I can read them in my Java code.
This is not a documented format, it is internal to the installer. You could build an additional Windows ZIP archive media file and extract that. It will have the same contents as the installer.

Stata - stacktrace not available

I would like to import csv files on stata. I do not understand why it does not work, I obtained : stacktrace not available
What should I do?
you cannot have non-ASCII characters in the STATA installation path. Up to now, Stata still requires ASCII.

How do I make a tarball with winrar from command line

This should be straight forward like it is with 7-zip, but it's not and google is not helping.
I'm doing the following at the command line
rar a -ep1 "C:\Mail\test.zip" "C:\Mail\LastEmail.txt"
and it keeps creating "test.zip" in rar archive format. It needs to be in zip format.
Ultimately I want to make a .tar.gz file.
The text file Rar.txt is the user's manual for console version Rar.exe.
The second and third paragraph in Introduction chapter at top of this file are:
RAR supports only RAR format archives, which have .rar file name extension by default. ZIP and other formats are not supported. Even if you specify .zip extension when creating an archive, it will still be in RAR format. Windows users may install WinRAR, which supports more archive types including RAR and ZIP formats.
WinRAR provides both graphical user interface and command line mode. While console RAR and GUI WinRAR have the similar command line syntax, some differences exist. So it is recommended to use this rar.txt manual for console RAR (rar.exe in case of Windows version) and winrar.chm WinRAR help file for GUI WinRAR (winrar.exe).
This is also true for free UnRAR.exe which is also a console application.
WinRAR.chm contains help of WinRAR.exe. On tab Contents there is the list item Command line mode with the Command line syntax page and the lists Commands and Switches. The page about switch -af<type> - specify archive format explains the difference that WinRAR.exe supports compressing and uncompressing ZIP archives with or without using this switch while console version Rar.exe does not support ZIP archives.

UTF-8 Encoding into TeamCity 9 build log

I use TeamCity 9 for continious integration. Machine running under Windows Server 2008 R2 - Russian. There are russian language PowerShell installed etc. In TeamCity build log, all russian symbols are in wrong encoding.
How to change encoding in build log?
UPD: Also I use Intellij IDEA for creating Maven project and I have 2 sql files with UTF-8 chars.
Please see the following post regarding encoding in TeamCity buildlog :::
Teamcity build log
This sounds like the very same q...
Kind regards