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

Windows shell extensions: Use custom GUIDs and prepare for MSI #2288

Merged
merged 15 commits into from
Aug 20, 2020

Conversation

misch7
Copy link
Member

@misch7 misch7 commented Aug 19, 2020

  • Integrate useful upstream commits from diverged history: Static linking, code cleanup

  • Use custom GUIDs via CMake and prepare MSI reg

    Previously side by side installation with ownCloud or other NC custom builds would break the shell integration because the same GUIDs and registry keys were used.

    Now we specify our custom GUIDs in NEXTCLOUD.cmake and use CMake to generate a header file and WiX (MSI) include file with these constants.

    Note: Using generators like "guidgen" or "uuidgen" ensures that GUIDs are unique, as manual changes are not guaranteed to be.

  • Rename all files and classes from OC* to NC*, update version info

    This also ensures a clear separation in the system registry.

    SelfReg is not recommended by Microsoft and will be handled by the MSI package to allow proper Repair and Uninstall.
    However, we keep it for backward compatibility with the NSIS installer.

    For details see:
    https://stackoverflow.com/questions/364187/how-do-you-register-a-win32-com-dll-file-in-wix-3#364210
    https://docs.microsoft.com/en-us/windows/win32/msi/selfreg-table#remarks

    Another fix by this PR:
    The "Version" registry value in the NCOverlays self reg should be a key and not a value.

    Details: https://wixtoolset.org/documentation/manual/v3/xsd/wix/class.html

    Example:

    [HKCR\CLSID\{01234567-89AB-CDEF-0123-456789ABCDEF}\Version]
    @="1.0.0.0"
    
  • Change NCUtil Pipe name from ownCloud to APPLICATION_EXECUTABLE

    Avoid interference with foreign pipes as this is always a bad idea ;p

  • Add WiX (MSI) fragment

    Use CMake to generate a WXI fragment to handle the DLL registration and file deployment for the shellext components.

@misch7 misch7 marked this pull request as draft August 19, 2020 17:24
@misch7 misch7 force-pushed the enh/windows-shellext branch from f1b1798 to b88cd6f Compare August 20, 2020 16:02
@misch7 misch7 marked this pull request as ready for review August 20, 2020 16:07
@misch7 misch7 requested a review from er-vin August 20, 2020 16:07
@er-vin
Copy link
Member

er-vin commented Aug 20, 2020

/rebase

@github-actions github-actions bot force-pushed the enh/windows-shellext branch from b88cd6f to f5d3f57 Compare August 20, 2020 16:43
ckamm and others added 15 commits August 20, 2020 18:50
To set the dll's metadata.

Signed-off-by: Michael Schuster <michael@schuster.ms>
It's a copy from OCContextMenu/resources.h

Signed-off-by: Michael Schuster <michael@schuster.ms>
Signed-off-by: Michael Schuster <michael@schuster.ms>
Otherwise we can't have operation that has many many filename

As reported in #6780

Signed-off-by: Michael Schuster <michael@schuster.ms>
Signed-off-by: Michael Schuster <michael@schuster.ms>
Signed-off-by: Michael Schuster <michael@schuster.ms>
Signed-off-by: Michael Schuster <michael@schuster.ms>
Signed-off-by: Michael Schuster <michael@schuster.ms>
Signed-off-by: Michael Schuster <michael@schuster.ms>
Signed-off-by: Michael Schuster <michael@schuster.ms>
Previously side by side installation with ownCloud or other NC custom builds would break the shell integration because the same GUIDs and registry keys were used.

Now we specify our custom GUIDs in NEXTCLOUD.cmake and use CMake to generate a header file and WiX (MSI) include file with these constants.

Note: Using generators like "guidgen" or "uuidgen" ensures that GUIDs are unique, as manual changes are not guaranteed to be.

Signed-off-by: Michael Schuster <michael@schuster.ms>
…*, update version info

This also ensures a clear separation in the system registry.

SelfReg is not recommended by Microsoft and will be handled by the MSI package to allow proper Repair and Uninstall.
However, we keep it for backward compatibility with the NSIS installer.

For details see:
https://stackoverflow.com/questions/364187/how-do-you-register-a-win32-com-dll-file-in-wix-3#364210
https://docs.microsoft.com/en-us/windows/win32/msi/selfreg-table#remarks

Another fix by this commit:
The "Version" registry value in the NCOverlays self reg should be a key and not a value.

Details: https://wixtoolset.org/documentation/manual/v3/xsd/wix/class.html

Example:

  [HKCR\CLSID\{01234567-89AB-CDEF-0123-456789ABCDEF}\Version]
  @="1.0.0.0"

Signed-off-by: Michael Schuster <michael@schuster.ms>
…PLICATION_EXECUTABLE

Avoid interference with foreign pipes as this is always a bad idea ;p

Signed-off-by: Michael Schuster <michael@schuster.ms>
Use CMake to generate a WXI fragment to handle the DLL registration and file deployment for the shellext components.

Signed-off-by: Michael Schuster <michael@schuster.ms>
Signed-off-by: Michael Schuster <michael@schuster.ms>
@misch7 misch7 force-pushed the enh/windows-shellext branch from f5d3f57 to 4df8db4 Compare August 20, 2020 16:53
@misch7 misch7 added this to the Desktop 3.0 milestone Aug 20, 2020
@nextcloud-desktop-bot
Copy link

AppImage file: Nextcloud-PR-2288-4df8db4ff6d35a99af3f2a101cb3f99960d1c68b-x86_64.AppImage

To test this change/fix you can simply download above AppImage file and test it.

Please make sure to quit your existing Nextcloud app and backup your data.

@misch7 misch7 merged commit b60239c into master Aug 20, 2020
@misch7 misch7 deleted the enh/windows-shellext branch August 20, 2020 19:11
@misch7
Copy link
Member Author

misch7 commented Aug 20, 2020

/backport to stable-3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants