7998: ANSI targets are deprecated - nsis

How can I resolve "7998: ANSI targets are deprecated"?
When I add Unicode True
I get error,
Error: Can't change target charset after data already got compressed or header already changed!
Error in script -- on line 58
-- aborting creation process

Unicode True needs to be set very early in your .NSI file, before any !include statements and before any File commands.

Related

DBPedia FactExtractor: fails on extract-pacges

I'm using the fact-extractor (link) to run their example of extracting info from the football wiki pages. I've installed and tested all dependencies on windows and when I execute "make extract-pages", i get the following error:
(dbpenv) C:\dbpedia\fact-extractor-master>make extract-pages
mkdir workspace-en
bzcat enwiki-latest-pages-articles.xml.bz2 | python lib/WikiExtractor.py -o workspace-en/pages
File "lib/WikiExtractor.py", line 598
print id, title.encode('utf-8')
^
SyntaxError: invalid syntax
bzcat: I/O or other error, bailing out. Possible reason follows.
bzcat: Invalid argument
Input file = enwiki-latest-pages-articles.xml.bz2, output file = (stdout)
make: *** [Makefile:39: extract-pages] Error 1
I can't make sense of the error. This is an as-is codebase from their repo so I'm not really sure how to fix this.

parsing SVG in webpack

I have created a project on Symfony 5. I am receiving an error in webpack when I run 'yarn build'. I am trying to fix it from few days but without success, so I decided to ask for some help :)
This is the error I am getting:
I have enabled postCssLoader in my webpack.config and created postss.config.js in my root directory
.enablePostCssLoader()
postss.config.js File
module.exports = {
plugins: [
require('autoprefixer'),
require('postcss-svgo'),
require('postcss-inline-svg'),
require('postcss-write-svg'),
]
}
And here is a sample of svg I am trying to write in my css
.custom-checkbox .custom-control-input:checked~.custom-control-label::after {
background-image: url('data:image/svg+xml,%3csvg xmlns=\'http://www.w3.org/2000/svg\' width=\'8\'
height=\'8\' viewBox=\'0 0 8 8\'%3e%3cpath fill=\'%23fff\' d=\'M6.564.75l-3.59 3.612-1.538-
1.55L0 4.26l2.974 2.99L8 2.193z\'/%3e%3c/svg%3e')
}
If the error transfers code verbatim, then there are two line breaks (and indentation) that makes the property invalid (see "CRLF": ..width=\'8\'CRLF height.. - this one you can backslash-escape in CSS, and ..1.538-CRLF 1.55L.. - this one with indentation separates numeral making path data invalid - you have to remove all whitespace between minus and digit). If this is it, simply removing line breaks (and suprefluous whitespace) should fix it:
background-image: url('data:image/svg+xml,%3csvg xmlns=\'http://www.w3.org/2000/svg\' width=\'8\' height=\'8\' viewBox=\'0 0 8 8\'%3e%3cpath fill=\'%23fff\' d=\'M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z\'/%3e%3c/svg%3e')
If code snippet you provided is not directly from your source code, then you have probably some formarrter breaking it in the process (?)
N.B. you don't usually have to escape SVG datauris so much, you could go with url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8' fill='%23fff'><path d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/></svg>") (i.e. the only escaped sequence is #->%23) and most interpreters should pick it up just fine. I'm not sure about your build stack, but I'd guess that "safe over-escaped format for obsolete IEs" could be produced as the build result; and if you use preprocessor you can embed 'dataurized' external resources, what could prevent such formatting accidents. (Ah, that's probably what the postcss-inline-svg is doing for you.)

MoveFileEx with MOVEFILE_REPLACE_EXISTING flag Fails with LastError = 183

We have an application that makes a backup of a configuration file by copying it to a sub-folder (see log file entry below) using the following command:-
BOOL b = MoveFileEx(ExistingFileSpec, NewFileSpec, MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH | MOVEFILE_COPY_ALLOWED);
This appears to work as expected on most systems but on two we get the following warning in our log file:-
11 Jun 2018 10:58:05.437 W. COMMON WARNING MoveFile failed on C:\Program Files\Configuration\Stores.xml to C:\Program Files\Configuration\Backup\Stores.xml LastError=183
Lasterror =183 means "ERROR_ALREADY_EXISTS"
This is odd since MOVEFILE_REPLACE_EXISTING is specifically meant to enable this command to work when the target file exists.
This is happening on Win7 x86 machines.
In a previous version of the code MoveFile was used but with a DeleteFile call immediately prior to ensure the target file did not exist. When the code was rolled back to this version it works.
Any suggestions?

How to run aspnet_regiis.exe in a deferred custom action and pass the value of INSTALLDIR property?

I have a custom action (RunEncryption2) that I'm using for encrypting a configuration file by using aspnet_regiis.exe. The custom action type that I'm using is an EXE with path referencing a directory (initial type 34) using deferred execution in system context (so the final type is 3106). The file that I want to encrypt is on INSTALLDIR, so I have a Set Property custom action (SetRunEncryption2, type 51) where I'm setting RunEncryption2=[INSTALLDIR]. My two custom actions look like this:
SetRunEncryption2
Property Name: RunEncryption2
Property Value: [INSTALLDIR]
RunEncryption2
Working Directory: WindowsFolder
File Name & Command line: [WindowsFolder]Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -pef "connectionStrings" "[CustomActionData]" -prov "DataProtectionConfigurationProvider"
When the installer runs, I get no error, however the file gets no encryption at all. When I review the log, I get the following:
MSI (s) (34:C0) [17:32:11:356]: Executing op: CustomActionSchedule(Action=RunEncryption2,ActionType=3106,Source=C:\WINDOWS\,Target=C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -pef "connectionStrings" "" -prov "DataProtectionConfigurationProvider",CustomActionData=C:\Test\)
From the log I can see that the CustomActionData property has been set correctly, however it hasn't been included as part of the command.
At this point the only way I have to make the command work is passing a hard-coded value of INSTALLDIR, otherwise it doesn't seem to work.
I have tried:
Not using CustomActionData, instead passing the value of INSTALLDIR as part of my command line directly.
Using a "Path in Property value" custom action with similar results.
When I run option 1 above, I get a 1722 error on the log:
MSI (s) (C4:50) [12:49:46:968]: Note: 1: 1722 2: RunEncryption2 3: C:\WINDOWS\ 4: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -pef "connectionStrings" "C:\Test\" -prov "DataProtectionConfigurationProvider"
Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action RunEncryption2, location: C:\WINDOWS\, command: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -pef "connectionStrings" "C:\Test\" -prov "DataProtectionConfigurationProvider"
MSI (s) (C4:50) [12:49:56:841]: Product: TestEncryption -- Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action RunEncryption2, location: C:\WINDOWS\, command: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -pef "connectionStrings" "C:\Test\" -prov "DataProtectionConfigurationProvider"
Does anyone know how can I do to correctly execute this command and dynamically pass the value of INSTALLDIR?
Finally found the problem was not in the custom action passing the properties, but in the way that aspnet_iisreg is expecting the parameters.
INSTALLDIR is passing the string with a trailing slash (e. gr. c:\Test\), when I hard coded the installation path I was passing c:\Test instead.
The solution consisted in creating another custom action that removes the trailing slash and stores the value in a new property, this then can be used as parameter for aspnet_iisreg.
By the way, as Michael Urman mentioned, there was no need to use CustomActionData. Thanks.

freebsd customized port tree can not build ports from category level

Freebsd 9.1 RC3
just for clarification first: the top level is at /usr/ports, the category level is at /usr/ports/devel
I am working on customized ports tree. Basically, just trim the original whole ports tree to what we need. And, for the most part, it is the same, like GIDs, UIDs, Mk/, Tools/, Templates, and in term of Makefile, I just change SUBDIR to what we need.
General Problem: for each individual ports, like running 'make install clean' at /usr/ports/devel/protobuf, everything works. But, the thing is that running 'make install clean' at category level, it breaks.
Actual Problem:
run 'make install clean -DBATCH' at usr/ports/devel
....
Usage: ./help2man.h2m.PL [--quiet] [--stdout|--output=FILE] [--locale=STRING] [--message-
dir=DIR]
gmake[1]: *** [help2man.el.h2m] Error 255
gmake[1]: Leaving directory `/usr/ports/misc/help2man/work/help2man-1.40.12'
Option include requires an argument
`help2man' generates a man page out of `--help' and `--version' output.
Usage: help2man [OPTION]... EXECUTABLE
-n, --name=STRING description for the NAME paragraph
-s, --section=SECTION section number for manual page (1, 6, 8)
-m, --manual=TEXT name of manual (User Commands, ...)
-S, --source=TEXT source of program (FSF, Debian, ...)
-L, --locale=STRING select locale (default "C")
-i, --include=FILE include material from `FILE'
-I, --opt-include=FILE include material from `FILE' if it exists
-o, --output=FILE send output to `FILE'
-p, --info-page=TEXT name of Texinfo manual
-N, --no-info suppress pointer to Texinfo manual
-l, --libtool exclude the `lt-' from the program name
--help print this help, then exit
--version print version number, then exit
EXECUTABLE should accept `--help' and `--version' options and produce output on
stdout although alternatives may be specified using:
-h, --help-option=STRING help option string
-v, --version-option=STRING version option string
--version-string=STRING version string
--no-discard-stderr include stderr when parsing option output
Report bugs to <bug-help2man#gnu.org>.
gmake: *** [help2man.el.1] Error 255
*** [do-build] Error code 1
Stop in /usr/ports/misc/help2man.
*** [/usr/ports/misc/help2man/work/.build_done.help2man._usr_local] Error code 1
Stop in /usr/ports/misc/help2man.
*** [build-depends] Error code 1
Stop in /usr/ports/devel/autoconf.
*** [/usr/ports/devel/autoconf/work/.configure_done.autoconf._usr_local] Error code 1
Stop in /usr/ports/devel/autoconf.
*** [build-depends] Error code 1
Stop in /usr/ports/devel/automake.
*** [/usr/ports/devel/automake/work/.configure_done.automake._usr_local] Error code 1
Stop in /usr/ports/devel/automake.
*** [build-depends] Error code 1
Stop in /usr/ports/devel/apr1.
*** [/usr/ports/devel/apr1/work/.configure_done.apr._usr_local] Error code 1
Stop in /usr/ports/devel/apr1.
*** [_apr1.realinstall] Error code 1
Stop in /usr/ports/devel.
structure of customized ports tree
# ls
GIDs Tools distfiles net xxxxxxxxxx x11-fonts KNOBS UIDs doc net-mgmt print Makefile bin graphics xxxxxxx security Makefile.inc converters xxxx.sh xxxxxxxxx textproc Mk databases lang xxxxxxxxx www Templates devel misc xxxxxxxxxxxx x11
# ls devel
autoconf-wrapper libevent makedepend py-asn1 py-setuptools automake libltdl p5-Locale-gettext py-asn1-modules swig13 Makefile automake-wrapper libpthread-stubs pcre py-dateutil zmq apr1 gettext libtool pkgconf py-protobuf autoconf gmake m4 protobuf py-pyzmq
By referring http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html
Note: You can build all the ports in a category or as a whole by running make in the top level directory, just like the aforementioned make fetch method. This is dangerous, however, as some ports cannot co-exist. In other cases, some ports can install two different files with the same filename.
Hope someone can help me out, thanks !
I hope you've resolved this by now. If not, freebsd-ports#freebsd.org or hackers#freebsd.org would be the best places to get answer to such questions.
It looks like at the time the help2man port was out of date/broken. Additionally, when adding or removing categories and directories from ports, you need to edit Mk/bsd.port.mk to update the relevant list.
It's also possible that some ports have dependencies on ports that were removed. You can try running make index and see if it can cleanly build the index or not. This is a good clue on stability of at least default options in ports. (conditional dependencies wont' get tested) Running portlint can also help validate a port and it's dependencies look OK.

Resources