[PATCH] D129263: Windows packaging script. Check administrator permissions and/or 7-Zip version.

Carlos Alberto Enciso via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 7 01:38:30 PDT 2022


CarlosAlbertoEnciso created this revision.
CarlosAlbertoEnciso added reviewers: hans, thieta, russell.gallop.
CarlosAlbertoEnciso added projects: All, LLVM.
CarlosAlbertoEnciso requested review of this revision.
Herald added a subscriber: llvm-commits.

Update the Windows packaging script.

As discussed here:
https://discourse.llvm.org/t/build-llvm-release-bat-script-options/63146/6
https://reviews.llvm.org/D127938#inline-1234370

Latest 7-zip versions (21.x) require administrator permissions to create symbolic links.

These are the changes in this patch:

- Check if any of the following conditions is true: a) Version of 7-zip is 20.x or older b) Script is running with administrator permissions


https://reviews.llvm.org/D129263

Files:
  llvm/utils/release/build_llvm_release.bat


Index: llvm/utils/release/build_llvm_release.bat
===================================================================
--- llvm/utils/release/build_llvm_release.bat
+++ llvm/utils/release/build_llvm_release.bat
@@ -1,6 +1,24 @@
 @echo off
 setlocal
 
+REM Script for building the LLVM installer on Windows.
+REM
+REM Note:
+REM   To enable the creation of symbolic links:
+REM   - Run the script with administrator permissions, or
+REM   - Use the 7-zip version 20.x or older.
+
+REM Check for correct 7-zip version and/or administrator permissions.
+for /f "delims=" %%i in ('7z.exe ^| findstr /r "2[1-3]"') do set version=%%i
+if not "%version%"=="" (
+  if not exist %SYSTEMROOT%\SYSTEM32\WDI\LOGFILES (
+    echo.
+    echo Script requires administrator permissions, or a 7-zip version 20.x or older.
+    echo Current version is "%version%"
+    exit /b
+  )
+)
+
 if "%1"=="" goto usage
 goto begin
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129263.442816.patch
Type: text/x-patch
Size: 929 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220707/3679cdc4/attachment.bin>


More information about the llvm-commits mailing list