1)I wasn't using the Shell.Execute to 'open' a font, instead i used the following command
Code:
Shell.Execute(_SystemFolder .."\\cmd.exe", "open", "/C COPY C:\Program Files (x86)\StoneRiver\Tracker PRO\Fonts\*.TTF C:\Windows\Fonts /Y", "", SW_SHOWNORMAL, true);
- Shell.Execute() spawns a new process and does not inherit the current access rights. This means that you will be running cmd.exe at user level, not admin. The user does not have the required rights to write into the FontFolder.
- There are multiple backslashes missing from the command, which will not perform properly as it is written now. It should be more like this:
Code:Shell.Execute(_SystemFolder .."\\cmd.exe", "open", "/C COPY C:\[HIGHLIGHT]\[/HIGHLIGHT]Program Files (x86)\[HIGHLIGHT]\[/HIGHLIGHT]StoneRiver\[HIGHLIGHT]\[/HIGHLIGHT]Tracker PRO\[HIGHLIGHT]\[/HIGHLIGHT]Fonts\[HIGHLIGHT]\[/HIGHLIGHT]*.TTF C:\[HIGHLIGHT]\[/HIGHLIGHT]Windows\[HIGHLIGHT]\[/HIGHLIGHT]Fonts /Y", "", SW_SHOWNORMAL, true);
- You need to place quotes around arguments which contain spaces.
Code:Shell.Execute(_SystemFolder .."\\cmd.exe", "open", "/C COPY [HIGHLIGHT]\"[/HIGHLIGHT]C:\\Program Files (x86)\\StoneRiver\\Tracker PRO\\Fonts\\*.TTF[HIGHLIGHT]\"[/HIGHLIGHT] [HIGHLIGHT]\"[/HIGHLIGHT]C:\\Windows\\Fonts[HIGHLIGHT]\"[/HIGHLIGHT] /Y", "", SW_SHOWNORMAL, true);
- You do better not using hard coded paths at all. Instead, use the available Session Variables, or call Shell.GetFolder() to retrieve the paths you need.
- For the reason explained in item 1, you should use File.Run() instead if you want to execute this command, as File.Run() would run the command with the same admin privileges as the parent process.
- If you perform the TTF file copy manually to the fonts folder, you may also need to register the font manually, using System.RegisterFont(). And this means you would also need to unregister the font manually upon uninstall, and delete the file manully, as Setup Factory does not undo any actions you performed via script.
2) The installation log shows 3 entries for my font. They are
1. "Success Install archive file:" <full source path of font>
2. "Success Register font: TFG Bar Code (TrueType), <full source path of font>
3. "Success File added to uninstall list: <full source path of font>
1. "Success Install archive file:" <full source path of font>
2. "Success Register font: TFG Bar Code (TrueType), <full source path of font>
3. "Success File added to uninstall list: <full source path of font>
3) I also have the standard file copy defined in Setup Factory, which did not work and hence attempted item# 1. (Find the screen shot below)
Also, I saw this, you could see if it makes a difference applying this hotfix.
Ulrich
Leave a comment: