cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
dushkin
Level 3

Basic MSI Project - Current directory

Hello all.
I am trying to run an executable which will be plcaed inside a directory. That directory resides near the setup.exe file in the same Disk1 directory in the Release.

For that, I tried to write a vbscript code as follows:
----------------------------------------------------

dim filesys, newfolder

set filesys=CreateObject("Scripting.FileSystemObject")

If not filesys.FolderExists("my dir path") Then

sCurPath = filesys.GetAbsolutePathName(".")
sCurPath = sCurPath + "my exe path"

'In case of spaces in path, add one/two/three ??? inverted commas at both sides of the path :

sCurPath = Chr(34) & sCurPath & Chr(34)

Set wshShell = CreateObject ("WScript.Shell")

If isnull(wshShell) Then
MsgBox "Error installing shell"
End If

wshShell.run sCurPath
End If
-----------------------------------------------------

I thought that GetAbsolutePathName will do the trick but it returned me win\sytem32 path...
Also, the current project is built on Document and Settings\blablabla.. so it definitely may have some spaces in the path!

Any advice?

Many thanks!
Labels (1)
0 Kudos
(2) Replies
RobertDickau
Flexera Alumni

Depending on your build settings, perhaps reading SETUPEXEDIR using Session.Property will return the directory you want?
0 Kudos
dushkin
Level 3

Thanks Robert, I will try that!
0 Kudos