Skip to content
This repository has been archived by the owner on Feb 19, 2019. It is now read-only.

shim exe with icon of the exe #579

Closed
ghiboz opened this issue Sep 25, 2014 · 15 comments
Closed

shim exe with icon of the exe #579

ghiboz opened this issue Sep 25, 2014 · 15 comments

Comments

@ghiboz
Copy link

ghiboz commented Sep 25, 2014

hi!
it's possible in the exe created into C:\ProgramData\chocolatey\bin that points to the latest update to have the icon of the correct exe and not all the same?

thanks

@TomOne
Copy link

TomOne commented Sep 25, 2014

👍 for this. I also would find it much nicer if the original exe icon would be used.

That is also the reason why there exist different icons for different programs, isn’t it? 😃

@gep13
Copy link
Member

gep13 commented Sep 25, 2014

For me, the advantage of the shim's is running the application's from the command line, so icons don't really matter for me. Personal preference I guess.

@codearoo
Copy link

I'm curious... why the "shim" versus mklink?

@TomOne
Copy link

TomOne commented Sep 25, 2014

I'm curious... why the "shim" versus mklink?

Because MS failed to correctly implement symlinks. To create symlinks on Windows requires administrator rights and attempting to run them from GUI (Explorer) fails with an error. In addition, they don’t resolve paths correctly (e.g. paths to DLLs are not resolved correctly).

@TomOne
Copy link

TomOne commented Sep 25, 2014

For me, the advantage of the shim's is running the application's from the command line, so icons don't really matter for me. Personal preference I guess.

I see shimgen as workaround for a broken symlink support in Windows. On Windows and on other operating systems, symlinks always inherit the icon of their target. IMHO that makes sense, doesn’t it?

@gep13
Copy link
Member

gep13 commented Sep 26, 2014

I see shimgen as workaround for a broken symlink support in Windows. On Windows and on other operating systems, symlinks always inherit the icon of their target. IMHO that makes sense, doesn’t it?

I don't disagree with you on that point. However, for me, the shims that end up in the Chocolatey\bin folder are things like dupfinder.exe, gitversion.exe, inspectcode.exe and various other things. None of these tools have a GUI, they all run from the command line. As a result, I typically never have a need to look in the Chocolatey\bin folder.

Other applications that are installed through Chocolatey almost always have Start Menu, or desktop links, so again, I don't need to go to the Chocolatey\bin folder. It is just as simple for me to hit the Windows key, type the first few character of the application name, and then hit enter.

Yes, it's personal preference.

@codearoo
Copy link

I see. How does one create their own shims? We might have a use. Are they
for directories too? Are MS directory junctions in better condition? I only
used them slightly. of course I've used Linux symbolic and hard links for
years.
On Sep 25, 2014 2:27 PM, "TomOne" notifications@github.com wrote:

I'm curious... why the "shim" versus mklink?

Because MS failed to correctly implement symlinks. To create symlinks on
Windows requires administrator rights and attempting to run them from GUI
(Explorer) fails with an error. In addition, they don’t resolve paths
correctly (e.g. paths to DLLs are not resolved correctly).


Reply to this email directly or view it on GitHub
#579 (comment)
.

@TomOne
Copy link

TomOne commented Sep 26, 2014

I see. How does one create their own shims? We might have a use.

ShimGen is non-free proprietary software: https://raw.githubusercontent.com/chocolatey/chocolatey/master/src/tools/shimgen.license.txt

I guess the Chocolatey devs won’t tell how it exactly works, otherwise they would have open-sourced it. 😃

@codearoo
Copy link

Wha????!! disappointing.

I can think of many many issues of Windows and Windows apps that could have
been easily resolved if Windows did have correctly working sym links.
On Sep 26, 2014 7:06 AM, "TomOne" notifications@github.com wrote:

I see. How does one create their own shims? We might have a use.

ShimGen is non-free proprietary software:
https://raw.githubusercontent.com/chocolatey/chocolatey/master/src/tools/shimgen.license.txt

I guess the Chocolatey devs won’t tell how it exactly works, otherwise
they would have open-sourced it. [image: 😃]


Reply to this email directly or view it on GitHub
#579 (comment)
.

@ferventcoder
Copy link
Contributor

ShimGen is non-free proprietary software: https://raw.githubusercontent.com/chocolatey/chocolatey/master/src/tools/shimgen.license.txt

It's possible that it could later be offered as a standalone product. I do doubt that it will be a free product though. At the current time we are wanting to see more folks making packages to take advantage of it.

@ghost
Copy link

ghost commented Oct 6, 2014

👍

@MetaMemoryT
Copy link

👍 for Atom

ferventcoder added a commit that referenced this issue Jan 2, 2015
This extracts the icons from the executable
ferventcoder added a commit that referenced this issue Jan 2, 2015
* stable:
  (doc) update release notes/nuspec
  (shimgen) update shims for choco
  (doc) remove KS message
  (GH-579)(shimgen) update shimgen to 0.4.0
@ferventcoder
Copy link
Contributor

If you want to play with this, there is a prerelease https://chocolatey.org/packages/chocolatey/0.9.8.29-alpha1

@ferventcoder ferventcoder self-assigned this Jan 2, 2015
@ferventcoder
Copy link
Contributor

So it works if it finds the path. However the working directory of shimgen doesn't find it appropriately :/

ferventcoder added a commit that referenced this issue Jan 6, 2015
Added an option for passing the full path so the exe can be resolved
for extracting the icon from.
ferventcoder added a commit that referenced this issue Jan 6, 2015
* stable:
  (GH-654) (shimgen) handle spaces in path to shim
  (maint) adding debug when running in debug mode
  (GH-579) update to shimgen 0.5.0
ferventcoder added a commit to ferventcoder/chocolatey that referenced this issue Jan 7, 2015
When trying to extract the icon out, if it fails, be sure to use the
default icon instead.
ferventcoder added a commit to ferventcoder/chocolatey that referenced this issue Jan 7, 2015
* stable:
  0.9.8.31
  0.9.8.31-beta2
  (doc) update changelog/nuspec
  (chocolatey-archiveGH-579)(shimgen) fallback to default icon when error
@kbauer
Copy link

kbauer commented Jun 26, 2015

Regarding shims vs mklink: Back when I still used Windows XP I used Windows's *.LNK files as shims for programs I wanted to start from the commandline.

The link contents just have to be

"EXECUTABLEPATH" %*

Instead of just "EXECUTABLEPATH", with execution path set appropriately. Then you need to add .LNK to the PATHEXT variable.

In order to allow calling the program as COMMAND.exe, adding a second link COMMAND.exe.lnk might do the trick.

One advantage of LNK files would be that it inherits the executable's icon. I am not aware of disadvantages. Sadly I'm also not aware of how to generate .LNK files.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants