Old 15th April 2020, 07:31   #1
ikreb
Junior Member
 
Join Date: Aug 2018
Posts: 14
Make command File buildable for windows and linux

Hello,

I want to run a nsis script for Windows and Linux. But they have different path separators (/ and \).

Example:

File files/test.txt ; for linux
File files\text.txt ; for windows

Is it possible to have a script which run on both operation systems?
ikreb is offline   Reply With Quote
Old 15th April 2020, 08:34   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,275
Yes, NSIS tries to translate \ to / for you and / works many places in Windows.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 15th April 2020, 13:54   #3
ikreb
Junior Member
 
Join Date: Aug 2018
Posts: 14
Well, I tried exactly this and it doesn't work. I have two scripts which are equal except the paths for the File command.

I use nsis 3.05 with Win10 and it doesn't work.
ikreb is offline   Reply With Quote
Old 15th April 2020, 20:18   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,275
It not working on Windows makes no sense, just use "dir\file.ext". If the compiler is executed on Linux it will translate the path to "dir/file.ext" automatically.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 15th April 2020, 21:05   #5
ikreb
Junior Member
 
Join Date: Aug 2018
Posts: 14
Sorry, you are right. But the back direction doesn't work.
ikreb is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump