Ruben
Posts: 57
Joined: Fri Apr 10, 2015 2:35 pm

Workaround for the "Could not access network location" error

Hello Team && Community,

Property Based Folders need the Property set early in the Install Parameters (Red in the screenshot.)
The property needs a valid path, like MY_VARDIR="C:". You cannot set it to "foo", because msiexec complains "could not access network location foo".
InstallParameters-RedGreen.png
InstallParameters-RedGreen.png (23.41 KiB) Viewed 10323 times
Unfortunately, this feels dirty. Does C: really always exist ? I don't know.

There seems to be a workaround (Green).
These two properties (MY_APPDATA_DIR and MY_APPDATA_SUBDIR) can be used successfully in a property based folder. Hey, they do not have a dirty initial value. Exactly what we want !

The difference is -probably- that they are in the "UI and empty" section. They are here by accident and I don't know how I made it.


Two questions come up:
  • Is this a valid workaround to avoid arbitrary initial values like "C:" ?
  • How can one place any new Property like MY_VARDIR in this wonderful "UI and empty" section ?
Thank you very much,
Ruben
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Workaround for the "Could not access network location" error

Hello Ruben,

The related error message is indeed thrown by Windows Installer during "Paths Resolution -> Cost Finalize" standard action if a property used to create a folder is not set to a valid path.
Is this a valid workaround to avoid arbitrary initial values like "C:" ?
No. To correct approach will be to use a custom action which always set the "MY_APPDATA_DIR" and "MY_APPDATA_SUBDIR" properties to a valid path. For instance, you can go to "Custom Actions" page and add a "Set installer property" custom action with sequence scheduled before "Paths Resolution" action group like this:
  • Property: MY_APPDATA_DIR
    Value: [WindowsVolume]
How can one place any new Property like MY_VARDIR in this wonderful "UI and empty" section ?
To show up there, you can create a new control on your dialogs (from "Dialogs" page) and associate the control with such a property which was not already defined in "Install Parameters" page.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Ruben
Posts: 57
Joined: Fri Apr 10, 2015 2:35 pm

Re: Workaround for the "Could not access network location" error

Daniel wrote: No. To correct approach will be to use a custom action which always set the "MY_APPDATA_DIR" and "MY_APPDATA_SUBDIR" properties to a valid path. For instance, you can go to "Custom Actions" page and add a "Set installer property" custom action with sequence scheduled before "Paths Resolution" action group ...
Indeed, we use these "Set Installer Property" Custom Actions before the Paths Resolution. These Actions set the valid paths.

But any Property must be initialized in the Install Parameters additionally. The Property Based Directory requires that, regardless of the Custom Actions.
And this is the place where we use the ugly makeshift value "C:". No way round. Is this right ?

Many thanks,
Ruben
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Workaround for the "Could not access network location" error

Hello Ruben,
But any Property must be initialized in the Install Parameters additionally. The Property Based Directory requires that, regardless of the Custom Actions.
And this is the place where we use the ugly makeshift value "C:". No way round. Is this right ?
Yes, this is right. There is no workaround you can use in "Install Parameters" page other than a hardcoded path.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sjeslis
Posts: 308
Joined: Mon Aug 22, 2011 11:40 pm
Contact: Website

Re: Workaround for the "Could not access network location" error

Running into this today. The situation gets worse because in my scenario the property based folder, and the file we are installing in it, needs to be accessed optionally only when a specific version of Adobe Acrobat is installed.

e.g. ADOBE_INSTALL_PATH <-- property based folder name
|
+--- plug_ins
Scott Jeslis
Senior Software Engineer
Cicero, Inc.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Workaround for the "Could not access network location" error

Hello Scott,

In this case you can add a search (ADOBE_EXISTS) for the desired Adobe Acrobat version. Just go to "Search" page and use the "Add/Remove Predefined Search..." context menu option to add a predefined search for the desired version of Adobe. Also, you can create the search from scratch if our predefined ones don't fullfill your needs. Then, you can go to "Files and Folders" page, select your "ADOBE_INSTALL_PATH" property-based folder and from its context menu choose "Go To Component" option. In "Organization" page just add the above search property (ADOBE_EXISTS) in the "Condition" field of the selected component. This way the property-based folder will be created at install time only if Adobe Acrobat exists on target machine.

However, please note that even when you condition the component of the property-based folder you will still have to initialize the folder property to a valid path to avoid the "Could not access network location" error.

If you have any questions just let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”