OldSquirrelForWindows icon indicating copy to clipboard operation
OldSquirrelForWindows copied to clipboard

Allow modification of generated wix template

Open peters opened this issue 11 years ago • 13 comments

During the release stage, check for template.release.wxi in the Release folder or in $(SolutionDir)

<?include template.release.wxi ?>

This would make it easy to add custom behavior to the generated Wix template.

peters avatar Sep 05 '13 06:09 peters

Being able to extend the templates is definitely on my radar, but I'd like to get v1 out the door which will cover:

  • generating installers and updaters
  • using the AppSetup extensibility points to do custom behaviour as C# code
  • creating a custom UI for your installer

Happy to throw around ideas and proposals for how this feature could/should work in the interim.

shiftkey avatar Sep 05 '13 06:09 shiftkey

@peters What would you want to customize? Since it's a managed installer all the screens come from managed code, so the wix template only provides the details of what files are installed.

distantcam avatar Sep 05 '13 07:09 distantcam

@distantcam Aha, did now know that. I would like to add the application to startup so it runs when windows starts.

peters avatar Sep 05 '13 08:09 peters

After install, the bootstrapper finds any file - in the build output - ending in .exe and starts them.

There's also IAppSetup components if you want to run C# scripts as part of the installation. I'm testing and documenting those next.

shiftkey avatar Sep 05 '13 08:09 shiftkey

Great! ;)

peters avatar Sep 05 '13 08:09 peters

The one thing we could do that would be easy, is just search the project / solution root for a template.wxs file and use that instead. Easy win.

anaisbetts avatar Sep 05 '13 21:09 anaisbetts

@paulcbetts Yeah, but then you'd have to make sure the template is right, and wix is finicky. I'm not a fan of handing users death star sized guns for their feet.

Also which template are we talking about? The app installer or the bootstrapper? I can think of reasons to customize both.

distantcam avatar Sep 05 '13 22:09 distantcam

@distantcam They don't have to use it :)

anaisbetts avatar Sep 06 '13 00:09 anaisbetts

@paulcbetts Yes, but you know they will. And then they will log issues here. :)

distantcam avatar Sep 06 '13 00:09 distantcam

@shiftkey IAppSetup, you only have to implement it in a class in your main assembly and it will be picked up by the installer right?

public class ShimmerConfig : IAppSetup
    {
        public IEnumerable<ShortcutCreationRequest> GetAppShortcutList()
        {
            throw new NotImplementedException();
        }

        public void OnAppInstall()
        {
            throw new NotImplementedException();
        }

        public void OnAppUninstall()
        {
            throw new NotImplementedException();
        }

        public void OnVersionInstalled(Version versionBeingInstalled)
        {
            throw new NotImplementedException();
        }

        public void OnVersionUninstalling(Version versionBeingUninstalled)
        {
            throw new NotImplementedException();
        }

        public bool LaunchOnSetup { get; private set; }
        public string Target { get; private set; }
    }

peters avatar Sep 06 '13 06:09 peters

That's the one

shiftkey avatar Sep 06 '13 07:09 shiftkey

@peters Yep. you don't actually have to implement it though, if you're just a typical app with a single EXE, just ignore it and What You Expect Will Happen™

anaisbetts avatar Sep 06 '13 18:09 anaisbetts

Great! ;)

peters avatar Sep 07 '13 10:09 peters