Recent

Author Topic: [SOLVED] How can I run Windows command before compile?  (Read 1328 times)

egsuh

  • Hero Member
  • *****
  • Posts: 1436
[SOLVED] How can I run Windows command before compile?
« on: August 10, 2024, 10:05:10 am »
I'd like to run

   sc stop fcgi1

before I compile an FCGI project. But defining it in project options as attached image does not work.
How can I do this?
« Last Edit: August 11, 2024, 06:33:14 am by egsuh »

TRon

  • Hero Member
  • *****
  • Posts: 3174
Re: How can I run Windows command before compile?
« Reply #1 on: August 10, 2024, 11:25:02 am »
Is that a proper representation of what you use for input ? I ask because in teh picture I do not see a clear (back)slash rather a striked W.

I am not familiar with sc, is it interactive (e.g. does it wait for you to press a key or answer a question) ?

For test (linux) I added a printf "hello world\n" and checked the "show all output line" option. At compilation the messages window then outputs "hello world". See also attached pictures.
All software is open source (as long as you can read assembler)

Thaddy

  • Hero Member
  • *****
  • Posts: 15553
  • Censorship about opinions does not belong here.
Re: How can I run Windows command before compile?
« Reply #2 on: August 10, 2024, 02:07:14 pm »
The paths look funny with the strikethrough capital W. That does not belong there.
If I smell bad code it usually is bad code and that includes my own code.

Rave

  • Full Member
  • ***
  • Posts: 170
Re: How can I run Windows command before compile?
« Reply #3 on: August 10, 2024, 04:24:45 pm »
The paths look funny with the strikethrough capital W. That does not belong there.
Might be a regional thing. Paths in Japanese Windows use a Yen symbol AFAIK. It could be similar here.

Thaddy

  • Hero Member
  • *****
  • Posts: 15553
  • Censorship about opinions does not belong here.
Re: How can I run Windows command before compile?
« Reply #4 on: August 10, 2024, 07:32:14 pm »
Does not make sense: the paths should adhere.
If I smell bad code it usually is bad code and that includes my own code.

egsuh

  • Hero Member
  • *****
  • Posts: 1436
Re: How can I run Windows command before compile?
« Reply #5 on: August 11, 2024, 06:32:46 am »
sc.exe is a Windows command, which can start, stop, install, or remove Windows services.
The capital W with cancellation line is backslash in Korean. It does not have any problem in paths.

I solved the issue by creating batch files. 

In the stopfcgi1.bat,

         d:\setups\nssm-2.24\win64\nssm.exe stop fcgi1

and in startfcgi1.bat,

         d:\setups\nssm-2.24\win64\nssm.exe start fcgi1


It is not important whether to use nssm or sc. I had to set my acount up not to ask whether I'll allow nssm.exe change device (in Windows).

Now I can compile FCGI server files without any hassle.

 

TinyPortal © 2005-2018