I have been using forward slashes in all paths, as we need to be able to be cross platform.

However, when I do so with firewall rules, it seems to be problematic.

I add a rule using execute program, as follows:

<runprogram> <program>netsh.exe</program> <programarguments>firewall add allowedprogram "${installdir}/jre/bin/java.exe" "${project.fullname} JRE"</programarguments> </runprogram>

The rule is added ok.

However, during uninstall I try and reverse it using the following:

<runprogram> <program>netsh.exe</program> <programarguments>firewall delete allowedprogram "${installDir}/jre/bin/java.exe"</programarguments> </runprogram>

However, this does NOT work - the rule is still there (Windows 7). However, if I change the slashes to backslashes for the delete, it works fine.

Thoughts?

asked 13 Mar '12, 17:01

bstoke's gravatar image

bstoke
16222224
accept rate: 0%


You can simply replace all forward slashes and always pass a path with backslashes to netsh. You can do this for example by doing:

<setInstallerVariableFromRegEx>
  <name>jre_java_path</name>
  <pattern>/</pattern>
  <substitution>\\</substitution>
  <text>${installdir}/jre/bin/java.exe</text>
</setInstallerVariableFromRegEx>

It is also documented in Variables section of InstallBuilder User Guide.

link

answered 14 Mar '12, 04:04

wojciechka's gravatar image

wojciechka ♦♦
7.8k61122
accept rate: 26%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×4
×2

Asked: 13 Mar '12, 17:01

Seen: 1,461 times

Last updated: 14 Mar '12, 04:04