|
17 | 17 | <MajorUpgrade DowngradeErrorMessage="A newer version of RedAlert is already installed." /> |
18 | 18 | <MediaTemplate EmbedCab="yes" /> |
19 | 19 |
|
| 20 | + <Icon Id="RedAlertIcon" SourceFile="$(var.DistDir)\assets\icon.ico" /> |
| 21 | + <Property Id="ARPPRODUCTICON" Value="RedAlertIcon" /> |
| 22 | + |
20 | 23 | <Directory Id="TARGETDIR" Name="SourceDir"> |
21 | 24 | <Directory Id="LocalAppDataFolder"> |
22 | | - <Directory Id="INSTALLFOLDER" Name="RedAlert" /> |
| 25 | + <Directory Id="INSTALLFOLDER" Name="RedAlert"> |
| 26 | + <Directory Id="PublicFolder" Name="public" /> |
| 27 | + <Directory Id="AssetsFolder" Name="assets" /> |
| 28 | + <Directory Id="DataFolder" Name="data" /> |
| 29 | + <Directory Id="NodeModulesFolder" Name="node_modules"> |
| 30 | + <Directory Id="Systray2Folder" Name="systray2" /> |
| 31 | + </Directory> |
| 32 | + </Directory> |
23 | 33 | </Directory> |
24 | 34 | <Directory Id="ProgramMenuFolder"> |
25 | 35 | <Directory Id="AppMenuFolder" Name="RedAlert" /> |
|
34 | 44 | <Component Id="ConfigFile" Guid="c3d4e5f6-a7b8-9012-cdef-123456789012"> |
35 | 45 | <File Id="ConfigJson" Source="$(var.DistDir)\config.json" KeyPath="yes" /> |
36 | 46 | </Component> |
| 47 | + <Component Id="VbsLauncher" Guid="f6a7b8c9-d0e1-2345-abcd-456789012345"> |
| 48 | + <File Id="RedAlertVbs" Source="$(var.DistDir)\RedAlert.vbs" KeyPath="yes" /> |
| 49 | + </Component> |
37 | 50 | </DirectoryRef> |
38 | 51 |
|
39 | 52 | <DirectoryRef Id="AppMenuFolder"> |
40 | 53 | <Component Id="StartMenuShortcut" Guid="d4e5f6a7-b8c9-0123-defa-234567890123"> |
41 | 54 | <Shortcut Id="AppShortcut" |
42 | 55 | Name="RedAlert" |
43 | 56 | Description="Pikud HaOref Siren Monitor" |
44 | | - Target="[INSTALLFOLDER]RedAlert.exe" |
45 | | - WorkingDirectory="INSTALLFOLDER" /> |
| 57 | + Target="[SystemFolder]wscript.exe" |
| 58 | + Arguments=""[INSTALLFOLDER]RedAlert.vbs"" |
| 59 | + WorkingDirectory="INSTALLFOLDER" |
| 60 | + Icon="RedAlertIcon" /> |
46 | 61 | <RemoveFolder Id="CleanAppMenu" On="uninstall" /> |
47 | 62 | <RegistryValue Root="HKCU" Key="Software\RedAlert" Name="installed" Type="integer" Value="1" KeyPath="yes" /> |
48 | 63 | </Component> |
|
52 | 67 | <Component Id="StartupShortcut" Guid="e5f6a7b8-c9d0-1234-efab-345678901234"> |
53 | 68 | <Shortcut Id="StartupLink" |
54 | 69 | Name="RedAlert" |
55 | | - Target="[INSTALLFOLDER]RedAlert.exe" |
56 | | - WorkingDirectory="INSTALLFOLDER" /> |
| 70 | + Target="[SystemFolder]wscript.exe" |
| 71 | + Arguments=""[INSTALLFOLDER]RedAlert.vbs"" |
| 72 | + WorkingDirectory="INSTALLFOLDER" |
| 73 | + Icon="RedAlertIcon" /> |
57 | 74 | <RegistryValue Root="HKCU" Key="Software\RedAlert" Name="autostart" Type="integer" Value="1" KeyPath="yes" /> |
58 | 75 | </Component> |
59 | 76 | </DirectoryRef> |
60 | 77 |
|
61 | 78 | <Feature Id="MainFeature" Title="RedAlert" Level="1"> |
62 | 79 | <ComponentRef Id="MainExe" /> |
63 | 80 | <ComponentRef Id="ConfigFile" /> |
| 81 | + <ComponentRef Id="VbsLauncher" /> |
64 | 82 | <ComponentRef Id="StartMenuShortcut" /> |
65 | 83 | <ComponentGroupRef Id="PublicFiles" /> |
66 | 84 | <ComponentGroupRef Id="AssetFiles" /> |
| 85 | + <ComponentGroupRef Id="DataFiles" /> |
67 | 86 | <ComponentGroupRef Id="Systray2Files" /> |
68 | 87 | </Feature> |
69 | 88 |
|
70 | 89 | <Feature Id="AutoStart" Title="Start with Windows" Level="1"> |
71 | 90 | <ComponentRef Id="StartupShortcut" /> |
72 | 91 | </Feature> |
73 | 92 |
|
74 | | - <!-- Launch app after install --> |
75 | | - <CustomAction Id="LaunchApp" FileKey="RedAlertExe" ExeCommand="" Return="asyncNoWait" /> |
| 93 | + <!-- Launch app after install (via VBS to hide console window) --> |
| 94 | + <CustomAction Id="LaunchApp" Directory="INSTALLFOLDER" ExeCommand="[SystemFolder]wscript.exe RedAlert.vbs" Return="asyncNoWait" /> |
76 | 95 | <InstallExecuteSequence> |
77 | 96 | <Custom Action="LaunchApp" After="InstallFinalize">NOT Installed OR REINSTALL</Custom> |
78 | 97 | </InstallExecuteSequence> |
|
0 commit comments