![]() |
#1 |
Junior Member
Join Date: Apr 2019
Posts: 5
|
Issue with executing a command
Hi Team,
For a number of evenings I have been struggling with the following. One of the things my installer does is it installs a Ruby gem. Prior to the installation, I want to remove all versions of the gem so that I can be sure only the specific version is running on the user's system. To accomplish this, I have been trying lots of different things, but none are working. When uninstalling manually, all I need to do is run: code: The issue is that some users may be running Ruby version 2.6.x, others are on 2.7.x. Therefore the path to the `gem.cmd` changes. I have created a macro that determines the correct path on the user's system to the `gem.cmd` file. This macro sets the value of the GEMCMD variable. This works fine. The problem comes when I try to instruct NSIS to execute the command. I have tried a number of different things, but neither of them uninstalls MyGem. Please see the code snippet below. The bottom four lines show my latest examples of things that I tried. The first of those works, but has the path hard-coded. The other three don't work. code: Thank you in advance for any advice on this. Marc. |
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,332
|
Change nsExec::ExecToStack to DetailPrint and post the output
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Apr 2019
Posts: 5
|
Anders,
I had been looking at the DetailPrint output, but the command was too long to fit in the window. I have now implemented the DumpLog function and reviewed things in the log file it creates. In there I found that the value of $GEMCMD ends in a newline... I have now implemented the Trim function and things are now working they way I want. Thanks again for putting me on the right track. Marc. |
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|