Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Ah, fond recollections of a decade ago in <https://sourceforge.net/p/portableapps/launcher/ci/default/t...>:

    ; We had fun deciding on these.
    ReadEnvStr $1 IPromiseNotToComplainWhenPortableAppsDontWorkRightInProgramFiles
    ${If} $1 S== "I understand that this may not work and that I can not ask for help with any of my apps when operating in this fashion."
        ${DebugMsg} "You're making me sad by the way you voided your warranty, running in Program Files."
    ${Else}
        ; This string doesn't let on about the disable switch (by design)
        MessageBox MB_OK|MB_ICONSTOP `$(LauncherProgramFiles)`
        Quit
    ${EndIf}
I’ve done one or two other extremely verbose environment variable names and values or function names, but this is the only one that’s springing to mind right now.

Not sure quite why we decided to allow it at all there, but I suspect I just had too much fun with it. Not sure why it ended up spelled “can not” instead of “cannot”, either.

(If you’re wondering about ${…} on If/Else/EndIf, that’s because NSIS is basically an assembly language and has only jumps for control flow; LogicLib.nsh provides nice control flow constructs via defines and macros, abstracting the automatic creation of labels and the right jumps so that that `${If} $1 S== "…"` compiles to `StrCmpS $1 "…" 0 ‹auto-else-label›`, `${Else}` to `Goto ‹auto-endif-label›; ‹auto-else-label›:`, and ${EndIf} to `‹auto-endif-label›:`.)



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: