文档首页> 部署 CodeArts Deploy> 常见问题> 自定义应用步骤问题> 解压文件> 原生命令Compress-Archive打包时包含反斜杠“\”
更新时间:2023-12-01 GMT+08:00
分享

原生命令Compress-Archive打包时包含反斜杠“\”

问题现象

日志信息提示“appears to use backslashes as path separators…”

原因分析

使用powershell原生命令,或者使用编译构建“Msbuild构建”步骤打包时,由于powershell原生命令Compress-Archive打包出来的文件路径分隔符采用反斜杠“\”,由于此打包方式普适性和平台兼容性差导致上述问题的产生。

处理方法

  1. 构建任务使用如下脚本进行构建打包:
    1
    2
    3
    4
    5
    nuget restore 
    msbuild /p:OutputPath=../buildResult/Release/bin 
    powershell Invoke-WebRequest -UseBasicParsing https://www.7-zip.org/a/7z1900-x64.exe -OutFile ./7zip.exe
    7zip.exe /S
    "C:/Program Files/7-Zip/7z.exe" a ./archive.zip ./buildResult/Release/bin/*
    
  2. 自定义打包请使用7-Zip打包工具进行打包。
分享:

解压文件 所有常见问题

more