(Deb) Create symlink in /usr/local/bin #54

Closed
opened 2026-01-29 16:28:17 +00:00 by claunia · 1 comment
Owner

Originally created by @lukastrkan on GitHub (Jun 16, 2019).

Hello,
is there a way to automaticly create symlink from install location to /usr/local/bin in deb package?

I did check #31 , but its quite old, you know.

Thanks

Originally created by @lukastrkan on GitHub (Jun 16, 2019). Hello, is there a way to automaticly create symlink from install location to /usr/local/bin in deb package? I did check #31 , but its quite old, you know. Thanks
Author
Owner

@qmfrederik commented on GitHub (Jun 16, 2019):

The approach from #31 should still work. That approach consists of:

  1. Creating a shell script which will end up in /usr/local/bin and invokes your program. You should place this file inside your C# project directory, and it should have contents like this:
#!/bin/sh
exec /usr/share/myprog/myprog
  1. Update your .csproj file so that this file is deployed to /usr/local/bin:
<Content Include="myprog.sh" CopyToPublishDirectory="PreserveNewest" LinuxFileMode="755">
    <LinuxPath>/usr/local/bin/myprog</LinuxPath>
</Content>

Can you give that a try and let me know whether it works?

@qmfrederik commented on GitHub (Jun 16, 2019): The approach from #31 should still work. That approach consists of: 1. Creating a shell script which will end up in /usr/local/bin and invokes your program. You should place this file inside your C# project directory, and it should have contents like this: ``` #!/bin/sh exec /usr/share/myprog/myprog ``` 2. Update your `.csproj` file so that this file is deployed to `/usr/local/bin`: ``` <Content Include="myprog.sh" CopyToPublishDirectory="PreserveNewest" LinuxFileMode="755"> <LinuxPath>/usr/local/bin/myprog</LinuxPath> </Content> ``` Can you give that a try and let me know whether it works?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/dotnet-packaging#54