Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct application shortcut created by MSI Installer #3296

Merged
merged 3 commits into from
Jun 29, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions share/windows/wix-patch.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<CPackWiXPatch>
<CPackWiXFragment Id="CM_FP_KeePassXC.exe">
<Shortcut Id="CM_SP_KeePassXC.exe" Directory="ProgramMenuFolder"
Name="KeePassXC" Icon="ProductIcon.ico"
WorkingDirectory="INSTALL_ROOT" Advertise="yes" />
</CPackWiXFragment>
<CPackWiXFragment Id="CM_CP_KeePassXC.exe">
<ProgId Id="KeePassXC.kdbx" Description="KeePass Password Database" Icon="CM_FP_KeePassXC.exe" IconIndex="1">
<Extension Id="kdbx" ContentType="application/x-keepass2">
Expand Down
53 changes: 40 additions & 13 deletions share/windows/wix-template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,56 @@
<?ifdef CPACK_WIX_UI_DIALOG?>
<WixVariable Id="WixUIDialogBmp" Value="$(var.CPACK_WIX_UI_DIALOG)"/>
<?endif?>

<FeatureRef Id="ProductFeature"/>

<UIRef Id="$(var.CPACK_WIX_UI_REF)" />

<FeatureRef Id="ProductFeature">
<ComponentRef Id="ApplicationShortcut" />
</FeatureRef>

<UI>
<UIRef Id="$(var.CPACK_WIX_UI_REF)" />
<Publish Dialog="ExitDialog"
Control="Finish"
Event="DoAction"
Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
</UI>

<?include "properties.wxi"?>
<?include "product_fragment.wxi"?>

<DirectoryRef Id="TARGETDIR">
<Directory Id="ProgramMenuFolder" />
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="KeePassXC"/>
</Directory>
</DirectoryRef>

<Property Id="WixSilentExecCmdLine" Value='"Taskkill" /IM KeePassXC.exe'/>
<CustomAction Id="KillKeePassXCInstall" BinaryKey="WixCA" DllEntry="WixSilentExec" Execute="immediate" Return="ignore"/>
<CustomAction Id="KillKeePassXCUninstall" BinaryKey="WixCA" DllEntry="WixSilentExec" Execute="immediate" Return="ignore"/>
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="ApplicationShortcut" Guid="*">
<Shortcut Id="ApplicationStartMenuShortcut"
Name="KeePassXC"
Target="[#CM_FP_KeePassXC.exe]"
Icon="ProductIcon.ico"
WorkingDirectory="INSTALL_ROOT"/>
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\KeePassXC" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>

<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch $(var.CPACK_PACKAGE_NAME)" />
<Property Id="WixShellExecTarget" Value="[#CM_FP_KeePassXC.exe]" />
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />

<Property Id="WixSilentExecCmdLine" Value='"Taskkill" /IM KeePassXC.exe' />
<CustomAction Id="KillKeePassXCInstall" BinaryKey="WixCA" DllEntry="WixSilentExec" Execute="immediate" Return="ignore" />
<CustomAction Id="KillKeePassXCUninstall" BinaryKey="WixCA" DllEntry="WixSilentExec" Execute="immediate" Return="ignore" />

<Property Id="WixQuietExecCmdLine" Value='"Taskkill" /IM keepassxc-proxy.exe /F'/>
<CustomAction Id="KillProxyInstall" BinaryKey="WixCA" DllEntry="WixQuietExec" Execute="immediate" Return="ignore"/>
<CustomAction Id="KillProxyUninstall" BinaryKey="WixCA" DllEntry="WixQuietExec" Execute="immediate" Return="ignore"/>
<Property Id="WixQuietExecCmdLine" Value='"Taskkill" /IM keepassxc-proxy.exe /F' />
<CustomAction Id="KillProxyInstall" BinaryKey="WixCA" DllEntry="WixQuietExec" Execute="immediate" Return="ignore" />
<CustomAction Id="KillProxyUninstall" BinaryKey="WixCA" DllEntry="WixQuietExec" Execute="immediate" Return="ignore" />

<InstallExecuteSequence>
<Custom Action="KillKeePassXCInstall" After="InstallInitialize"/>
<Custom Action="KillProxyInstall" After="InstallInitialize"/>
<Custom Action="KillKeePassXCInstall" After="InstallInitialize" />
<Custom Action="KillProxyInstall" After="InstallInitialize" />
<Custom Action="KillKeePassXCUninstall" Before="InstallValidate">Installed</Custom>
<Custom Action="KillProxyUninstall" Before="InstallValidate">Installed</Custom>
</InstallExecuteSequence>
Expand Down