Polyglot: Difference between revisions
From NSIS Wiki
Jump to navigationJump to search
m (→C/C++: Simplify) |
(Added .cmd) |
||
| Line 1: | Line 1: | ||
[[Category:Code Examples]] | [[Category:Code Examples]] | ||
== Batch (NT) == | |||
<highlight-nsis> | |||
/*>nul 2>&1&@echo off&rem Note that this line will be visible when executed | |||
echo Hello World | |||
goto :EOF &rem */ | |||
Page InstFiles | |||
Section | |||
DetailPrint "Hello World" | |||
SectionEnd | |||
</highlight-nsis> | |||
== C/C++ == | == C/C++ == | ||
| Line 15: | Line 29: | ||
Section | Section | ||
DetailPrint "Hello World" | |||
SectionEnd | SectionEnd | ||
!if 0 | !if 0 | ||
| Line 20: | Line 35: | ||
#include <stdio.h> | #include <stdio.h> | ||
int main() | |||
{ | { | ||
printf("Hello World\n"); | return !printf("Hello World\n"); | ||
} | } | ||
#if 0 | #if 0 | ||
Revision as of 17:05, 21 September 2025
Batch (NT)
/*>nul 2>&1&@echo off&rem Note that this line will be visible when executed echo Hello World goto :EOF &rem */ Page InstFiles Section DetailPrint "Hello World" SectionEnd
C/C++
#define /* !define /**/ MYNUMBER 1234
#if 0 /* NSIS */ Page InstFiles Section DetailPrint "Hello World" SectionEnd !if 0 #else /* C */ #include <stdio.h> int main() { return !printf("Hello World\n"); } #if 0 !endif #endif #endif //~ EOF */