Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExeFileShortcut changing folder name #656

Closed
fschlaef opened this issue Jun 7, 2019 · 2 comments
Closed

ExeFileShortcut changing folder name #656

fschlaef opened this issue Jun 7, 2019 · 2 comments

Comments

@fschlaef
Copy link

fschlaef commented Jun 7, 2019

Hello,

I am having an issue with ExeFileShortcut

This code

project.AddDir(new Dir(@"%ProgramMenu%\My Company",
      new ExeFileShortcut("My Product", "[INSTALL_DIR]\\MySystem\\MyProduct.exe", arguments: "")));

Generates this

<Shortcut Id="ProgramMenuFolder.My_Company.My_Product" WorkingDirectory="ProgramMenuFolder.My_Company.My_Product.WorkDir" Target="[INSTALL_DIR]\MySystemFolder\MyProduct.exe" Name="My Product.lnk" />

System got renamed to SystemFolder and the link doesn't work.
I tried with SystZem and it works, but I cannot rename the actual folder.

I assume it has something to do with wix variables but I didn't enclose them in % so I'm at loss here.

I have no workaround

@oleg-shilo
Copy link
Owner

Thank you for reporting this problem. Unfortunately it is a defect and it will be fixed in the next release. For now please use this work around:

new Dir(@"%ProgramMenu%\My Company\My Product",
    new ExeFileShortcut("My Product", @"[INSTALL_DIR]\MySystem\MyProduct.exe", arguments: ""),
. . .                    
project.WixSourceFormated += Project_WixSourceFormated;
project.BuildMsi();

. . .

static void Project_WixSourceFormated(ref string content)
{
    content = content.Replace("MySystemFolder", "MySystem");
}

@oleg-shilo oleg-shilo added the bug label Jun 10, 2019
oleg-shilo pushed a commit that referenced this issue Jul 4, 2019
- Issue #658: Question: how to close running application or wait until user close application manually
- Issue #656: ExeFileShortcut changing folder name
- Issue #649: How to add permissions to regkey
- Issue #647: Interrupt CA execution #647;
- Implemented `Session.IsCanceled`
- Added `File.OnProcess` and `DirFiles.OnProcess` to provide custom handling on processing wildcards:
  ```
  new Files(@"..\Release Folder\test\*.exe")
  {
      OnProcess = file =>
      {
          file.OverwriteOnInstall = true;
      }
  }, . . .
  ```
@fschlaef
Copy link
Author

Confirmed working 👍

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

No branches or pull requests

2 participants