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

Error when deploying under windows if the folder path contains spaces. #3

Open
yurygolub opened this issue Jun 21, 2023 · 2 comments
Open

Comments

@yurygolub
Copy link

I'm trying to build windows setup, but I'm getting an error. Looks like spaces in the path to PostPublish.bat cause it.

d:\Path to folder\PupNet-HelloWorld>dotnet tool run pupnet --kind setup
PupNet Deploy 1.5.0
Configuration: HelloWorld.pupnet.conf

============================================================
APPLICATION: HelloWorld 1.0.3 [1]
============================================================

AppBaseName: HelloWorld
AppId: zone.kuiper.helloworld
AppVersion: 1.0.3
PackageRelease: 1
StartCommand: helloworld
SetupCommandPrompt: Command Prompt

============================================================
OUTPUT: SETUP
============================================================

PackageKind: Setup
Runtime: win-x64
Arch: Auto (x64)
Build: Release
OutputName: HelloWorld.x64.exe
OutputDirectory: d:\Path to folder\PupNet-HelloWorld\Deploy/bin

============================================================
BUILD PROJECT: PupNet-HelloWorld
============================================================

dotnet publish "d:\Path to folder\PupNet-HelloWorld" -r win-x64 -c Release -p:Version=1.0.3 --self-contained true -p:DebugType=None -p:DebugSymbols=false -o "C:\Users\User\AppData\Local\Temp\KuiperZone.PupNet\zone.kuiper.helloworld-win-x64-Release-Setup\AppDir\Publish"

d:\Path to folder\PupNet-HelloWorld\Deploy/PostPublish.bat

============================================================
BUILD PACKAGE: HelloWorld.x64.exe
============================================================

iscc /O"d:\Path to folder\PupNet-HelloWorld\Deploy/bin" "C:\Users\User\AppData\Local\Temp\KuiperZone.PupNet\zone.kuiper.helloworld-win-x64-Release-Setup\HelloWorld.iss"

============================================================
ISSUES
============================================================

NONE

Continue? [N/y]: Y
Remove: . ... OK
Create Directory: . ... OK
Create Directory: AppDir ... OK
Create Directory: AppDir\Publish ... OK
Create File: AppDir\Publish\helloworld.bat ... OK
Create File: AppDir\Publish\CommandPrompt.bat ... OK

Building Project ...
cmd /C dotnet publish "d:\Path to folder\PupNet-HelloWorld" -r win-x64 -c Release -p:Version=1.0.3 --self-contained true -p:DebugType=None -p:DebugSymbols=false -o "C:\Users\User\AppData\Local\Temp\KuiperZone.PupNet\zone.kuiper.helloworld-win-x64-Release-Setup\AppDir\Publish"
MSBuild version 17.6.1+8ffc3fe3d for .NET
  Determining projects to restore...
  Restored d:\Path to folder\PupNet-HelloWorld\HelloWorld\HelloWorld.csproj (in 83 ms).
C:\Program Files\dotnet\sdk\7.0.302\Current\SolutionFile\ImportAfter\Microsoft.NET.Sdk.Solution.targets(36,5): warning NETSDK1194: The "--output" option isn't supported when building a solution. Specifying a solution-level output path results in all projects copying outputs to the same directory, which can lead to inconsistent builds. [d:\Path to folder\PupNet-HelloWorld\HelloWorld.sln]
  HelloWorld -> d:\Path to folder\PupNet-HelloWorld\HelloWorld\bin\Release\net6.0\win-x64\HelloWorld.dll
  HelloWorld -> C:\Users\User\AppData\Local\Temp\KuiperZone.PupNet\zone.kuiper.helloworld-win-x64-Release-Setup\AppDir\Publish\

cmd /C d:\Path to folder\PupNet-HelloWorld\Deploy/PostPublish.bat
'd:\Path' is not recognized as an internal or external command,
operable program or batch file.

FAILED
cmd returned non-zero exit code 1
@kuiperzone
Copy link
Owner

Yes, it looks like you are correct. Will take a look. Thank you

@kuiperzone
Copy link
Owner

I have a taken a look at this. This is not a bug.

cmd /C d:\Path to folder\PupNet-HelloWorld\Deploy/PostPublish.bat

The solution is simply to put quotes around the DotnetPostPublish or DotnetPostPublishOnWindows values in your config file. The values are not necessarily simple script filenames, but may theoretically contain commands, hence why I did not ensure they were quoted prior to be called.

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

No branches or pull requests

2 participants