Archive: Convert $INSTDIR to UNIX-style Path


Convert $INSTDIR to UNIX-style Path
Hello. I have a strange problem that I'm not sure how to solve. I'm building a custom installer for the Apache web server with NSIS v1.98. The installer includes a function that builds the Apache configuration file (httpd.conf). This file contains settings that require a listing of the installation directory path, but unfortunately the backslashes (\) must be converted to UNIX-style slashes (/). I'm at a loss for how to convert $INSTDIR to this format. I considered writing the file and then using the search for string method listed in other messages in this forum, but I can't use it because there are backslashes in other settings within the file that cannot be replaced with a forward slash.

Any ideas are greatly appreciated.


Regards,
Garrel Renick


On second thought, I think I have an idea based on the search and replace method listed in:

http://forums.winamp.com/showthread....hreadid=118073

It seems I should just write $INSTDIR to a file, then use the script provided in the thread above to do the conversion. Does that make sense? Is there an easier way?


Here is a function which does exactly what you need:

http://nsis.sourceforge.net/archive/...ances=0,11,122

Edit: (It's the 2nd function on that page)

-Stu


Thank you! I'm *always* impressed with the prompt and detailed help in this forum.

Regards,
Garrel Renick


Me too!!
This forum has the greatest support possible!!!


-Stu :)