Skip to content
⌘ NSIS Forum Archive

${textreplace::ReplaceInFile}

3 posts

marcins#

${textreplace::ReplaceInFile}

In my code I have a few lines with ${textreplace::ReplaceInFile}.

    ${textreplace::ReplaceInFile} "$INSTDIR\apache2\conf\httpd.conf" "$INSTDIR\apache2\conf\httpd.conf" "htdocs" "www-root" "/S=1 /C=1 /AO=1" $0

${textreplace::ReplaceInFile} "$INSTDIR\apache2\conf\httpd.conf" "$INSTDIR\apache2\conf\httpd.conf" "index.html" "index.html index.php" "/S=1 /C=1 /AO=1" $0

${textreplace::ReplaceInFile} "$INSTDIR\apache2\conf\httpd.conf" "$INSTDIR\apache2\conf\httpd.conf" "#LoadModule rewrite_module modules/mod_rewrite.so" "LoadModule rewrite_module modules/mod_rewrite.so" "/S=1 /C=1 /AO=1" $0

${textreplace::ReplaceInFile} "$INSTDIR\apache2\conf\httpd.conf" "$INSTDIR\apache2\conf\httpd.conf" "AllowOverride None" "AllowOverride All $\r$\n$\tLimitRequestBody 0" "/S=1 /C=1 /AO=1" $0
And I don't know why, but sometimes it works, and sometimes it doesn't!

Any idea why?
JasonFriday13#
Are you stopping Apache first before changing the config? Some apps don't like it when the config files are changed when the program is running.