Page 1 of 1

variables as paths to run?

Posted: 13 Oct 2023 02:09
by shokarta
hello guys....

so lets say i have this line i need to run:

Code: Select all

c:\Qt\6.6.0\mingw_64\bin\windeployqt6.exe --qmldir c:\Qt\Projects\Sources\game_test c:\Qt\Projects\Builds\build-game_test-Desktop_Qt_6_6_0_MinGW_64_bit-Release\appgame_test.exe --compiler-runtime
so i was thinking of something like:

Code: Select all

set /p "windeployqt6"="c:\Qt\6.6.0\mingw_64\bin\windeployqt6.exe"
set /p "sourceDir"="c:\Qt\Projects\Sources\game_test"
set /p "appPath"="c:\Qt\Projects\Builds\build-game_test-Desktop_Qt_6_6_0_MinGW_64_bit-Release\appgame_test.exe"

%windeployqt6% --qmldir %sourceDir% %appPath% --compiler-runtime
but unfortunatelly this does not work... so how can I do this?

Re: variables as paths to run?

Posted: 13 Oct 2023 03:31
by ShadowThief
The /p flag is only meant for prompting the user for input, and you only need quotes around the assignment, not on each side of the equals sign - this isn't an if statement.

Code: Select all

set "windeployqt6=c:\Qt\6.6.0\mingw_64\bin\windeployqt6.exe"
set "sourceDir=c:\Qt\Projects\Sources\game_test"
set "appPath=c:\Qt\Projects\Builds\build-game_test-Desktop_Qt_6_6_0_MinGW_64_bit-Release\appgame_test.exe"

%windeployqt6% --qmldir %sourceDir% %appPath% --compiler-runtime

Re: variables as paths to run?

Posted: 14 Oct 2023 05:06
by Batcher
test-1.bat

Code: Select all

set "windeployqt6=c:\Qt\6.6.0\mingw_64\bin\windeployqt6.exe"
set "sourceDir=c:\Qt\Projects\Sources\game_test"
set "appPath=c:\Qt\Projects\Builds\build-game_test-Desktop_Qt_6_6_0_MinGW_64_bit-Release\appgame_test.exe"
"%windeployqt6%" --qmldir "%sourceDir%" "%appPath%" --compiler-runtime
test-2.bat

Code: Select all

set windeployqt6="c:\Qt\6.6.0\mingw_64\bin\windeployqt6.exe"
set sourceDir="c:\Qt\Projects\Sources\game_test"
set appPath="c:\Qt\Projects\Builds\build-game_test-Desktop_Qt_6_6_0_MinGW_64_bit-Release\appgame_test.exe"
%windeployqt6% --qmldir %sourceDir% %appPath% --compiler-runtime