Unable to run batch script along with installation setup

Comments

3 comments

  • Avatar
    michiel

    Hi Srujan,

     

    Could you give more details about what you mean when you say the script is running but not perfectly? Is it giving the wrong output? Is it working only partially?

    Regards,

    Michiel

     

    0
    Comment actions Permalink
  • Avatar
    Srujan B

    Through installation setup, script is executing but not perfectly and same thing is executing manually when we run in admin mode from the installation path(Post installation). For reference, please find the below script that i am trying to execute from installation setup.

    For setting my executable to compatible to windows 7 in windows 7 platform.
    Option 1:
    setlocal
    cd /d %~dp0
    for /f "tokens=4-5 delims=. " %%i in ('ver') do set VERSION=%%i.%%j
    if "%version%" == "6.1" (start reg.exe Add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v %ProgramFiles%\MyparentFolder\MyFolder\myExecutable.exe /d "WIN7RTM" /f)
    endlocal
    EXIT


    Option 2:
    setlocal
    cd /d %~dp0
    for /f "tokens=4-5 delims=. " %%i in ('ver') do set VERSION=%%i.%%j
    if "%version%" == "6.1" (start reg.exe Add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "%~dp0myExecutable.exe" /d "WIN7RTM" /f)
    endlocal
    EXIT

    Option 3:
    setlocal
    cd /d %~dp0
    for /f "tokens=4-5 delims=. " %%i in ('ver') do set VERSION=%%i.%%j
    if "%version%" == "6.1" (start reg.exe delete "HKLM\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "%~dp0myExecutable.exe" /f)
    if "%version%" == "6.1" (start reg.exe Add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "%~dp0myExecutable.exe" /d "WIN7RTM" /f)
    endlocal
    EXIT

    If you have any option or sample script that can be added in bitrock script itself (rather than going for batch script), please let me know.

    Please let me know if anything else i need to provide.



    Thank you.

    0
    Comment actions Permalink
  • Avatar
    michiel

    Hi,

    Could you try to enable the <wrapInScript> option?

     

    <runProgram>
       ...
       <wrapInScript>1</wrapInScript>
       ...

    </runProgram>


    Regards,

    Michiel

    0
    Comment actions Permalink

Please sign in to leave a comment.