14

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

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Yogesh
  • 155
  • 1
  • 9
  • 1
    Please post a [Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example) that illustrates your problem – idleberg Nov 10 '20 at 09:05
  • Add "Unicode True" where? What is the context? – Peter Mortensen May 04 '21 at 14:37
  • If you think about it, once you starting writing, to change from pencil to pen and back is destructive. Saying "change to pencil" should be done before writing begins at all. Same thing that message is saying. – Jared Farrish May 04 '21 at 15:12

1 Answers1

15

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

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Anders
  • 97,548
  • 12
  • 110
  • 164
  • It can be after `!include` statements. [NSIS Documentation](https://nsis.sourceforge.io/Docs/Chapter4.html#aunicodetarget): _It can only be used outside of sections and functions and before any data is compressed._ – skst Jun 14 '21 at 04:00
  • 1
    @skst It depends on the header, it is better to just put it first in the script. – Anders Jun 14 '21 at 16:19