Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8387099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:07:20+00:00 2026-06-09T18:07:20+00:00

I have the following NSIS code Function CreateDesktopSC ;Creates Desktop Shortcut SetShellVarContext current SetOutPath

  • 0

I have the following NSIS code

Function CreateDesktopSC
    ;Creates Desktop Shortcut
    SetShellVarContext current
    SetOutPath "$DOCUMENTS\Foo\"
    SetShellVarContext all
    detailprint "Icon path: $INSTDIR\Bar\icon.ico"
    CreateShortCut "$DESKTOP\${productName}.lnk" "$INSTDIR\Bar\binary.exe" "" "$INSTDIR\Bar\icon.ico" 0
FunctionEnd

The install log shows the following (from the detailprint command)
Icon path: C:\Program Files (x86)\Bar\icon.ico

The shortcut is created, but with the icon from the executable.

If I open the lnk file or right click the shortcut and click “Change Icon …”, I get the error “Windows can’t find the file %ProgramFiles%\Bar\icon.ico.”

If I browse to %ProgramFiles%, it takes me to c:\Program Files, not the x86 version as shown in the detailsprint command. The icon file exists, but in the x86 folder.

It appears that either NSIS or windows is replacing “C:\Program Files (x86)\” with “%ProgramFiles%”, which doesn’t point to the x86 version.

The actual path to the executable is correct, it’s only the icon link which is incorrect.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T18:07:22+00:00Added an answer on June 9, 2026 at 6:07 pm

    The workaround from the thread is to add an second \ to your icon code. I didn’t really got why this helps on 64bit systems but it does…

    so replace:

    CreateShortCut "$SMPROGRAMS\$StartMenuGroup\${PRODUCT_NAME}.lnk" "yourapp.exe" "$INSTDIR\${APPLICATION_ICON}"
    

    with

    CreateShortCut "$SMPROGRAMS\$StartMenuGroup\${PRODUCT_NAME}.lnk" "yourapp.exe" "$INSTDIR\\${APPLICATION_ICON}"
    

    After adding the second \ before APPLICATION_ICON the icon will be displayed again

    Confusing but it works

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following script that executes all the .reg files in the current directory.
I have following code that creates Linq query. I've never used Linq until today
Have following Java code,that creates StringBuilder with \n,i.e. carriage return delimiters: while (scanner.hasNextLine()){ sb.append(scanner.nextLine()).append(\n);
I have following code in initialization im = imread('Image02.tif'); figure(); imagesc(im); colormap(gray); [hImage hfig
I am using Visual Basic 6 I have the following code structure: FUNCNINFO is
Have following listener for keyboard ArrowDown event(it's key code is 40 ): window.onload =
I have following files and directories in my project root directory main.py bar.py foo
I have following code in C# PasswordDeriveBytes DerivedPassword = new PasswordDeriveBytes(Password, SaltValueBytes, HashAlgorithm, PasswordIterations);
I have following code in C# PasswordDeriveBytes DerivedPassword = new PasswordDeriveBytes(Password, SaltValueBytes, HashAlgorithm, PasswordIterations);
Have following code: public interface ITest { string St1 { get; } } public

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.