Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
37 changes: 32 additions & 5 deletions nextcloud.nsi
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
;Nextcloud installer script.
!if "$%USE_BRANDING%" == "1"
!define APPLICATION_NAME "$%APP_NAME%"
!else
!define APPLICATION_NAME "nextcloud"
!endif

!define APPLICATION_SHORTNAME "nextcloud"
!define APPLICATION_NAME "Nextcloud"
!define APPLICATION_SHORTNAME "${APPLICATION_NAME}"
!define APPLICATION_VENDOR "$%APPLICATION_VENDOR%"
!define APPLICATION_EXECUTABLE "nextcloud.exe"
!define APPLICATION_CMD_EXECUTABLE "nextcloudcmd.exe"
!define APPLICATION_EXECUTABLE "${APPLICATION_NAME}.exe"
!define APPLICATION_CMD_EXECUTABLE "${APPLICATION_NAME}cmd.exe"
!define APPLICATION_CONFIG_FILE "nextcloud.cfg"
!define APPLICATION_DOMAIN "nextcloud.com"
!define APPLICATION_LICENSE ""
!define WIN_SETUP_BITMAP_PATH "$%PROJECT_PATH%\desktop\admin\win\nsi"
Expand Down Expand Up @@ -433,7 +438,7 @@ Section "${APPLICATION_NAME}" SEC_APPLICATION
!finalize '"${CURRENT_PATH}\sign.bat" "%1"'
!endif
!if ${UPLOAD_BUILD} != 0
!finalize '"${CURRENT_PATH}\upload.bat" %1' ; note: %1 quotes intenionally removed!
!finalize '"${CURRENT_PATH}\upload.bat" %1' ; note: %1 quotes intentionally removed!
!endif
SectionEnd
!endif ;IS_INNER_SIGN_UNINSTALLER
Expand Down Expand Up @@ -558,6 +563,28 @@ Section -post
WriteRegDWORD ${MEMENTO_REGISTRY_ROOT} "${MEMENTO_REGISTRY_KEY}" "NoRepair" "1"


;Respect user choices for the client's first launch.
Var /GLOBAL configFileName
StrCpy $configFileName "$APPDATA\${APPLICATION_NAME}\${APPLICATION_CONFIG_FILE}"

!ifdef OPTION_SECTION_SC_SHELL_EXT
Var /GLOBAL showInExplorerNavigationPane

${If} ${SectionIsSelected} ${SEC_SHELL_EXT}
StrCpy $showInExplorerNavigationPane "true"
${Else}
StrCpy $showInExplorerNavigationPane "false"
${EndIf}

CreateDirectory "$APPDATA\${APPLICATION_NAME}"

SetShellVarContext all
DeleteINIStr "$configFileName" "General" "showInExplorerNavigationPane"
WriteIniStr "$configFileName" "General" "showInExplorerNavigationPane" "$showInExplorerNavigationPane"
SetShellVarContext current
!endif


SetDetailsPrint textonly
DetailPrint $UNINSTALLER_FINISHED_Detail
SectionEnd
Expand Down
16 changes: 15 additions & 1 deletion single-build-desktop.bat
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,20 @@ if "%BUILD_TYPE%" == "Debug" (
) else (
set WINDEPLOYQT_BUILD_TYPE=release
)

if "%USE_BRANDING%" == "1" (
start "mv nextcloud" /B /wait mv "%MY_INSTALL_PATH%/bin/nextcloud.exe" "%MY_INSTALL_PATH%/bin/%APP_NAME%.exe"
start "mv nextcloudcmd" /B /wait mv "%MY_INSTALL_PATH%/bin/nextcloudcmd.exe" "%MY_INSTALL_PATH%/bin/%APP_NAME%cmd.exe"
if exist "%MY_INSTALL_PATH%/bin/nextcloud/" (
start "mkdir " /B /wait "%WIN_GIT_PATH%\usr\bin\mkdir.exe" -p "%MY_INSTALL_PATH%/bin/%APP_NAME_SANITIZED%/"
start "mv bin files" /B /wait mv "%MY_INSTALL_PATH%/bin/nextcloud/"* "%MY_INSTALL_PATH%/bin/%APP_NAME_SANITIZED%/"
start "rm branded dir" /B /wait rm -drf "%MY_INSTALL_PATH%/bin/nextcloud/"
start "mkdir %MY_INSTALL_PATH%/config/%APP_NAME%/" /B /wait "%WIN_GIT_PATH%\usr\bin\mkdir.exe" -p "%MY_INSTALL_PATH%/config/%APP_NAME%/"
start "mv config files" /B /wait mv "%MY_INSTALL_PATH%/config/nextcloud/"* "%MY_INSTALL_PATH%/config/%APP_NAME%/"
start "rm branded dir" /B /wait rm -drf "%MY_INSTALL_PATH%/config/nextcloud/"
)
)

echo "* Run windeployqt to collect all %APP_NAME%.exe dependencies and output it to %MY_QT_DEPLOYMENT_PATH%/."
start "windeployqt" /B /wait windeployqt.exe --%WINDEPLOYQT_BUILD_TYPE% --compiler-runtime "%MY_INSTALL_PATH%/bin/%APP_NAME%.exe" --dir "%MY_QT_DEPLOYMENT_PATH%/"
if %ERRORLEVEL% neq 0 goto onError
Expand All @@ -171,4 +185,4 @@ if "!%*!" == "" (
echo "Missing environment variable: %*"
exit /B 1
)
exit /B
exit /B
4 changes: 2 additions & 2 deletions single-build-installer-collect.bat
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ if "%USE_CODE_SIGNING%" == "0" (
"shellext/OCUtil.dll"
"%APP_NAME_SANITIZED%.exe"
"%APP_NAME_SANITIZED%cmd.exe"
"%APP_NAME_SANITIZED%sync.dll"
"nextcloudsync.dll"
"OCContextMenu.dll"
"OCOverlays.dll"
"ocsync.dll"
Expand Down Expand Up @@ -260,4 +260,4 @@ if "!%*!" == "" (
echo "Missing environment variable: %*"
exit /B 1
)
exit /B
exit /B