Search code examples
nsis

How to do string replacement in nsis?


I want to do string replacement in NSIS for following string: C:/Program Files (86) replaced into C:/Program Files.

I have searched and got this link for string replacement.

From that link i need to include whole functions. It may maximize the coding. Is there any built-in functions is there or any other way is possible?


Solution

  • NSIS only has 3 basic string instructions: StrCpy, StrLen and StrCmp. Everything else is built on top of that with macros and functions...

    Transforming "Program Files (86)" to something else is not a good idea, the Program Files folder could have a different name (On my system it is called Applications)! Use $ProgramFiles32 or $ProgramFiles64 to get the directory you want...