From 8119712fccb71a2c0d5c9b49d49aa212b067ada2 Mon Sep 17 00:00:00 2001 From: Chris Duck Date: Fri, 26 Jan 2018 16:32:23 -0600 Subject: [PATCH] Adds script to patch the shortcut working directory to the user's home folder. Works around MSI's insistence on expanding environment variables at install time. --- assets/Product.wxs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/assets/Product.wxs b/assets/Product.wxs index 69b77e1a044..b88fd5da8b1 100644 --- a/assets/Product.wxs +++ b/assets/Product.wxs @@ -43,6 +43,18 @@ + + + shortcutPath = Session.Property("ShortcutPath") + Set fso = CreateObject("Scripting.FileSystemObject") + if (fso.FileExists(shortcutPath)) Then + Set wshShell = CreateObject("WSCript.Shell") + Set shortcut = wshShell.CreateShortcut(shortcutPath) + + shortcut.workingdirectory = "%HOMEDRIVE%%HOMEPATH%" + shortcut.save + End If +