client-building icon indicating copy to clipboard operation
client-building copied to clipboard

With branding enabled the generated exe is still nextcloud.exe

Open supportreq opened this issue 5 years ago • 9 comments

I tried compiling the windows package with branding enabled, yet the output generated was nextcloud.exe and the build failed as the script was searching for brandedname.exe

Please advice how to created a branded theme

supportreq avatar Mar 24 '20 09:03 supportreq

i have the same problem:

When changing the "APP_NAME"- and "APP_NAME_SANITIZED"-Values, then the build fails because it couldn't find the according .exe-file

Have you figured out, what the problem here is @supportreq ?

fyi @misch7

edvinkuric avatar Sep 22 '20 14:09 edvinkuric

Probably hit the same problem. Build failed with the following log when tried to change app name:

...
  -- Installing: C:/Nextcloud/client-building/install/Release/Win64/i18n/client_sl.qm
  -- Installing: C:/Nextcloud/client-building/install/Release/Win64/i18n/client_sr.qm
  -- Installing: C:/Nextcloud/client-building/install/Release/Win64/i18n/client_sv.qm
  -- Installing: C:/Nextcloud/client-building/install/Release/Win64/i18n/client_th.qm
  -- Installing: C:/Nextcloud/client-building/install/Release/Win64/i18n/client_tr.qm
  -- Installing: C:/Nextcloud/client-building/install/Release/Win64/i18n/client_uk.qm
  -- Installing: C:/Nextcloud/client-building/install/Release/Win64/i18n/client_zh_CN.qm
  -- Installing: C:/Nextcloud/client-building/install/Release/Win64/i18n/client_zh_TW.qm
  -- Installing: C:/Nextcloud/client-building/install/Release/Win64/bin/HeliosFiles.exe
  -- Installing: C:/Nextcloud/client-building/install/Release/Win64/bin/NCContextMenu.dll
  -- Installing: C:/Nextcloud/client-building/install/Release/Win64/bin/NCOverlays.dll
"* Run windeployqt to collect all Nextcloud.exe dependencies and output it to c:/Nextcloud/client-building/install/Release/Win64/qt-libs/."
"c:\Nextcloud\client-building\install\Release\Win64\bin\Nextcloud.exe" does not exist.

"*** Build FAILED: desktop Release Win64 (single-build-desktop.bat)"
"***** Build FAILED (build.bat)"

I was able to compile a branded client after changing a few variables and other stuff in nextcloud.nsi (from this repo):

APPLICATION_SHORTNAME
APPLICATION_NAME
APPLICATION_EXECUTABLE
APPLICATION_CMD_EXECUTABLE
APPLICATION_CONFIG_FILE
APPLICATION_DOMAIN
CRASHREPORTER_EXECUTABLE

https://github.com/nextcloud/client-building/blob/d51978e4d718f94179d04b1390b47241c7831c21/nextcloud.nsi#L62 https://github.com/nextcloud/client-building/blob/d51978e4d718f94179d04b1390b47241c7831c21/nextcloud.nsi#L82 https://github.com/nextcloud/client-building/blob/d51978e4d718f94179d04b1390b47241c7831c21/nextcloud.nsi#L85

as well as defaults.inc.bat (also from this repo) https://github.com/nextcloud/client-building/blob/b9429de4274526ad81a6be56af52df920b1f6c76/defaults.inc.bat#L23 https://github.com/nextcloud/client-building/blob/b9429de4274526ad81a6be56af52df920b1f6c76/defaults.inc.bat#L24

I also changed a few things in NEXTCLOUD.cmake from https://github.com/nextcloud/desktop APPLICATION_NAME https://github.com/nextcloud/desktop/blob/ce71ffe9f9c78a84a2698c18ff16923ba4230f96/NEXTCLOUD.cmake#L1 APPLICATION_SHORTNAME https://github.com/nextcloud/desktop/blob/ce71ffe9f9c78a84a2698c18ff16923ba4230f96/NEXTCLOUD.cmake#L2 APPLICATION_EXECUTABLE https://github.com/nextcloud/desktop/blob/ce71ffe9f9c78a84a2698c18ff16923ba4230f96/NEXTCLOUD.cmake#L3 APPLICATION_DOMAIN https://github.com/nextcloud/desktop/blob/ce71ffe9f9c78a84a2698c18ff16923ba4230f96/NEXTCLOUD.cmake#L4

Not sure which changes were really necessary and if I understand correctly some settings from this repo can override settings from the actual client repo. This all is very confusing, building for macos was much easier.

This is not directly related but I also was able to customize almost all icons and images just by replacing the original files in https://github.com/nextcloud/desktop/tree/ce71ffe9f9c78a84a2698c18ff16923ba4230f96/theme and https://github.com/nextcloud/desktop/tree/ce71ffe9f9c78a84a2698c18ff16923ba4230f96/admin/win/nsi I didn't have any problems with png and svg but all bmp files have to be converted with bmp3 option in imagemagick (after convert welcome-created-in-gimp.bmp bmp3:welcome.bmp you should use welcome.bmp). Also still not sure if I created installer.ico correctly using convert -background transparent image.png -define icon:auto-resize=16,24,32,48,64,128,256 installer.ico.

stszap avatar Oct 16 '20 07:10 stszap

I got it running by applying 2 fixes to the scripts (need just to build, brand and create MSI):

  • single-build-desktop.bat line 166, APP_NAME_SANITIZED has to be used for the .exe

  • single-build-installer-collect.bat line 137, APP_NAME_SANITIZED has to be used for the /sync-exclude.lst

I am using

APP_NAME=Some long nice name here
APP_NAME_SANITIZED=someshortlowercasename

theming works nicely by just passing

set CMAKE_EXTRA_FLAGS_DESKTOP=-DOEM_THEME_DIR="C:/Nextcloud/oem/someshortlowercasename" -DWITH_PROVIDERS=OFF

NOTE: there were NO changes required in the original NC Desktop Client code (as designed).

ThumbGen avatar Jun 22 '21 11:06 ThumbGen

Oh, it seems the OEM_THEME_DIR just got removed in 'master'. The solution above works just for <3.2.2. Starting with 3.2.3 the only way is to replace images/variables in the original repository.

ThumbGen avatar Jun 24 '21 10:06 ThumbGen

I got it running by applying 2 fixes to the scripts (need just to build, brand and create MSI):

  • single-build-desktop.bat line 166, APP_NAME_SANITIZED has to be used for the .exe
  • single-build-installer-collect.bat line 137, APP_NAME_SANITIZED has to be used for the /sync-exclude.lst

Hi, can you paste the lines you changed in the .bat files ?

vagner-dias avatar Jun 29 '21 04:06 vagner-dias

single-build-desktop.bat, line 166 start "windeployqt" /B /wait %QT_BIN_PATH%/windeployqt.exe --%WINDEPLOYQT_BUILD_TYPE% --compiler-runtime "%MY_INSTALL_PATH%/bin/%APP_NAME_SANITIZED%.exe" --dir "%MY_QT_DEPLOYMENT_PATH%/" --qmldir "%MY_REPO%/src/gui" -websockets

single-build-installer-collect.bat, line 137 start "copy sync-exclude.lst" /D "%MY_COLLECT_PATH%/" /B /wait cp -af "%MY_INSTALL_PATH%/config/%APP_NAME_SANITIZED%/sync-exclude.lst" "%MY_COLLECT_PATH%/"

Basically APP_NAME -> APP_NAME_SANITIZED

ThumbGen avatar Jun 29 '21 16:06 ThumbGen

single-build-desktop.bat, line 166 start "windeployqt" /B /wait %QT_BIN_PATH%/windeployqt.exe --%WINDEPLOYQT_BUILD_TYPE% --compiler-runtime "%MY_INSTALL_PATH%/bin/%APP_NAME_SANITIZED%.exe" --dir "%MY_QT_DEPLOYMENT_PATH%/" --qmldir "%MY_REPO%/src/gui" -websockets

single-build-installer-collect.bat, line 137 start "copy sync-exclude.lst" /D "%MY_COLLECT_PATH%/" /B /wait cp -af "%MY_INSTALL_PATH%/config/%APP_NAME_SANITIZED%/sync-exclude.lst" "%MY_COLLECT_PATH%/"

Basically APP_NAME -> APP_NAME_SANITIZED

Thank you!!

vagner-dias avatar Jun 29 '21 16:06 vagner-dias

single-build-desktop.bat, line 166 start "windeployqt" /B /wait %QT_BIN_PATH%/windeployqt.exe --%WINDEPLOYQT_BUILD_TYPE% --compiler-runtime "%MY_INSTALL_PATH%/bin/%APP_NAME_SANITIZED%.exe" --dir "%MY_QT_DEPLOYMENT_PATH%/" --qmldir "%MY_REPO%/src/gui" -websockets

single-build-installer-collect.bat, line 137 start "copy sync-exclude.lst" /D "%MY_COLLECT_PATH%/" /B /wait cp -af "%MY_INSTALL_PATH%/config/%APP_NAME_SANITIZED%/sync-exclude.lst" "%MY_COLLECT_PATH%/"

Basically APP_NAME -> APP_NAME_SANITIZED

I have using this way, but failed. The console reported cannot find file c:/Nextcloud/collect/Release/Win64\Nextcloud.ico I've checked the path, the icon file was named as %APP_NAME_SANITIZED.ico

zydisney avatar Aug 02 '21 07:08 zydisney

Hmm, not sure what else is missing in your case, but we've managed to (internally) automate building and branding the client successfully. Be sure you have a proper OEM.cmake where

set( APPLICATION_ICON_NAME "mybrandname" )

ThumbGen avatar Aug 02 '21 08:08 ThumbGen