How can I get the installation folder path and put in a variable using VBScript?
My VBScript put files to certain folders and I want to do it dynamically.
How can I get the installation folder path and put in a variable using VBScript?
My VBScript put files to certain folders and I want to do it dynamically.
I did an alternative to this problem. I used Shell.BrowseForFolder method to browse for a folder and returned its path:
function fnShellBrowseForFolderVB()
dim objShell
dim ssfWINDOWS
dim objFolder
ssfWINDOWS = 36
set objShell = CreateObject("shell.application")
set objFolder = objShell.BrowseForFolder(0, "Example", 0, ssfWINDOWS)
if (not objFolder is nothing) then
'Add code here.
end if
set objFolder = nothing
set objShell = nothing
end function
Hope this helps everyone.
The answer is that you can't because Visual Studio setups don't have that capability. All custom actions, vbscripts, C++, C# or whatever all run after the files have been installed. There is no capability to run code before or during that UI sequence. If you want to get the location from somewhere on the system, setup projects have a search that might work to get the default value.