joefio
Posts: 23
Joined: Thu Apr 20, 2023 2:14 pm

Get installer location's full UNC path

Fri Jun 02, 2023 3:19 pm

Hello I am having an issue when retrieving the UNC path of my .msi installer.

The installer is run from a network directory (EX: \\FRTD\QUAD\QV\Setup\setup.msi). At the end of the installation this path needs to be passed to a config.exe program.

If I copy/paste \\FRTD\QUAD\QV\Setup\ into a file explorer and run setup.msi I can use the [OriginalDatabase] property to retrieve the full path(\\FRTD\QUAD\QV\Setup\setup.msi) and everything works correctly.

However if I access setup.msi through a mapped network drive it does not return the full path. Typically a user would access the installer through a mapped drive to the QUAD directory. When this is the case [OriginalDatabase] returns 'V:\QV\Setup\setup.msi' instead of the full network path.

I call my config.exe using a "Launch File" custom action and pass [OriginalDatabase] as a Command line argument.

Config.exe needs the full UNC path in order to configure correctly. Is there any way to get the full UNC path of setup.msi if you are running it through a mapped drive directory?

Thanks
Joe F
Attachments
AIerror.PNG
AIerror.PNG (13.62KiB)Viewed 9610 times

Catalin
Posts: 6537
Joined: Wed Jun 13, 2018 7:49 am

Re: Get installer location's full UNC path

Wed Jun 07, 2023 11:42 am

Hello Joe,

To be fully honest with you, this seems like a limitation of Windows Installer, considering the OriginalDatabase property is proprietary to Windows Installer.

Besides that property, I would check the following two as well:

- SourceDir

- TARGETDIR

You could check these two in the log file and perhaps any will point to the right UNC path, instead of the mapped drive.

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

joefio
Posts: 23
Joined: Thu Apr 20, 2023 2:14 pm

Re: Get installer location's full UNC path

Thu Jun 15, 2023 1:55 pm

Catalin wrote:
Wed Jun 07, 2023 11:42 am
Hello Joe,

To be fully honest with you, this seems like a limitation of Windows Installer, considering the OriginalDatabase property is proprietary to Windows Installer.

Besides that property, I would check the following two as well:

- SourceDir

- TARGETDIR

You could check these two in the log file and perhaps any will point to the right UNC path, instead of the mapped drive.

Hope this helps!

Best regards,
Catalin
Hi Catalin,

The other properties appear to return the same thing so I assume it is a limitation. We were able to work around this by generating a list of network drives via a vbs script that calls "net use" from an unelevated CMD(must be unelevated to view non admin drives believe it or not) and printing the output to a text file. "Net use" generates a list of mapped drives and their corresponding UNC paths. I modified our config program to simply parse the text file to get the full UNC path based on the mapped drive letter that was passed. Overall we are happy with this solution, I just wanted to make sure there wasn't an easier way first.

Thanks for all your help
Joe F

Catalin
Posts: 6537
Joined: Wed Jun 13, 2018 7:49 am

Re: Get installer location's full UNC path

Fri Jun 16, 2023 3:23 pm

Thank you very much for your followup on this and for sharing your solution with us, Joe!

I am sure this will be helpful for further users facing a similar scenario.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”