Quote at the end of the URL - Advanced Installer Community
mtilev
Posts: 44
Joined: Wed Dec 04, 2013 1:19 pm

Quote at the end of the URL

Hello,

after sucessful installation on pressing the "Finish" button of our installer we launch the system browser at a certain URL by means of a "Open URL" custom action. The target URL contains a URL parameter which is set to the value of the [SETUPEXEDIR] installer property:

Code: Select all

http://localhost:[TOMCAT_PORT]/app/home.jsf?path=[SETUPEXEDIR]
The browser, however, opens at the following URL:

Code: Select all

http://localhost:8082/app/home.jsf?path=C:\install%22
, i.e. one with a trailing URL-encoded quote character.

Are we doing something wrong and how can we prevent the quote character from being appended to the constructed URL?

Thanks in advance,

Milen Tilev
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Quote at the end of the URL

Hi Milen,

I tested your scenario, but I couldn't reproduce the behavior. Can you please send us the .AIP (project file) and a verbose log of the installation to support at advancedinstaller dot com so we can investigate them? Also, can you give us an example of how your URL should look?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mtilev
Posts: 44
Joined: Wed Dec 04, 2013 1:19 pm

Re: Quote at the end of the URL

Dear Eusebiu,

I've just sent the email as requested.

Sincerely,

Milen Tilev
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Quote at the end of the URL

Hello Milen,

We have tested your scenario on multiple machines and we were able to replicate the behavior only on a Windows Vista x64 machine with Google Chrome as default browser. We are not sure why this is happening, but after investigating this further it seems this is also happening when manually creating a shortcut to URL. For example using the following test case:
- on "Desktop" location from the context menu choose "New -> Shortcut" option
- in the "Type the location of the item" field add the following URL

Code: Select all

http://localhost:8082/app/home.jsf?path=C:\install\
- click on [Next] and [Finish] buttons
- double click on the created URL shortcut

the Google Chrome browser will display the following URL in the "URL" field

Code: Select all

http://localhost:8082/app/home.jsf?path=C:\install"
We are not sure why this is happening (maybe this is a Chrome limitation). However, in order to avoid this behavior, you can try to create a custom action which will parse the "SETUPEXEDIR" property value, will replace the "\" character with its corresponding URL encoded character (%5C) and will place the result into another installer property (COMPUTED_SETUPEXEDIR). Then, you can use the "COMPUTED_SETUPEXEDIR" property in your custom action "URL" field.

I have added an improvement on our TODO list so that in a future version of Advanced Installer our "Open URL" custom action automatically parse the URL characters and replace the required ones with their corresponding URL encoded characters. We will let you know when this improvement will be available.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mtilev
Posts: 44
Joined: Wed Dec 04, 2013 1:19 pm

Re: Quote at the end of the URL

Diear Daniel,

thanks again for your support.

I've just written a custom action, which urlencodes the SETUPEXEDIR property and stores the result into another property called ENCODED_SETUPEXEDIR:

Code: Select all

var path = encodeURIComponent(Session.Property("SETUPEXEDIR"));
Session.Property("ENCODED_SETUPEXEDIR") = path;
Also, I use this proerty in our custom action URL field:

Code: Select all

http://localhost:[TOMCAT_PORT]/app/home.jsf?path=[ENCODED_SETUPEXEDIR]
Still, I'm not getting the result I was hoping to achieve (the ENCODED_SETUPEXEDIR property seams to have an empty value, when the browser is launched). Next, I declared the property on the Install Parameters page and assigned it an initial value. According to the MSI log file, the value actually gets updates as our new custom action is executed:

Code: Select all

MSI (s) (CC!54) [18:20:50:318]: PROPERTY CHANGE: Modifying ENCODED_SETUPEXEDIR property. Its current value is 'ENCODED_SETUPEXEDIR'. Its new value: 'C%3A%5Ctest%5Ctest_install%5C'.
However, when launching the browser, it is the initial value that gets passed into the url. I guess I'm missing something about evaluation order of installer properties...
Can you give me a hint about what's going wrong here?

Thanks in advance

Milen
mtilev
Posts: 44
Joined: Wed Dec 04, 2013 1:19 pm

Re: Quote at the end of the URL

Just to answer my own question:

I moved the new custom action which urlescapes the SETUPEXEDIR property from previously the install execution stage to the wizard dialogs stage and that solves the problem. As I mentioned in my initial posting, we launch the browser with the given URL on click of the "Finish" button of the first time install wizard, so the escaped property is needed within the wizard dialogs stage.

Greetings

Milen Tilev
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Quote at the end of the URL

Hello Milen,

First of all I apologize for my delayed reply. We are quite busy at the moment.

Indeed, I can confirm your solution is correct. Your ENCODED_SETUPEXEDIR property didn't preserved its value set during the "Install Execution Stage" because this is the default Windows Installer property. A public property value is preserved only from UI Stage to Install Execution Stage, vice versa this is not true. So, if you set a public property during the "Install Execution Stage", then its value will not be preserved during UI stage too.

If there is anything we can help you with just let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mtilev
Posts: 44
Joined: Wed Dec 04, 2013 1:19 pm

Re: Quote at the end of the URL

Hello Daniel,

thank you for this clarification on public installer properties.

Kind regards,

Milen Tilev
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Quote at the end of the URL

You're always welcome Milen.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Quote at the end of the URL

Hello,

This improvement has been added in version 11.3 of Advanced Installer released on June 17th, 2014.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mtilev
Posts: 44
Joined: Wed Dec 04, 2013 1:19 pm

Re: Quote at the end of the URL

Hello Dan,

This is great news! :-)
I'll take a look at it as soon as possible.

Greetings,

Milen Tilev
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Quote at the end of the URL

You're welcome Milen,

If you have other questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”