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

pandoc-1.14.0.1-windows.msi fails to inform where it installs #2205

Closed
hholst80 opened this issue Jun 2, 2015 · 33 comments
Closed

pandoc-1.14.0.1-windows.msi fails to inform where it installs #2205

hholst80 opened this issue Jun 2, 2015 · 33 comments

Comments

@hholst80
Copy link

hholst80 commented Jun 2, 2015

I have just installed pandoc-1.14.0.1-windows.msi by double clicking on the installer. Where are the binaries installed?

@nkalvi
Copy link

nkalvi commented Jun 2, 2015

Could you try typing where pandoc in a new command-window?

If you're under Windows 8.1, you may want to re-login before starting the command windows.

@jgm
Copy link
Owner

jgm commented Jun 2, 2015

See #1403

This is a frequent problem and I really wish someone could tell me how to tweak the wix setup so that the path adjustment would be recognized right away. Failing that, how to have it tell people where the binary is. I'm tempted to just start delivering a zip with the binary and a few docs.

@hholst80
Copy link
Author

hholst80 commented Jun 2, 2015

C:\Users\hholst>where pandoc
INFO: Could not find files for the given pattern(s).

C:\Users\hholst>

Pandoc is installed according to Control Panel.

EDIT: NM I found the binaries in:

C:\Users\hholst\AppData\Local\Pandoc.

It is not added to my %PATH% as far as I can see?

C:\Program Files (x86)\SCE\ORBIS\Tools\Target Manager Server\bin;E:\gnuplot\bin;
E:\MinGW\bin;C:\Program Files (x86)\SCE\ORBIS SDKs\1.700\host_tools\bin;C:\Progr
am Files (x86)\SCE\Common\SceVSI-VS12\bin;C:\Program Files (x86)\SCE\Common\SceV
SI-VS11\bin;C:\Program Files (x86)\SCE\ORBIS\Tools\Publishing Tools\bin;C:\Progr
amData\Oracle\Java\javapath;C:\Program Files\Common Files\Microsoft Shared\Windo
ws Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\win
dows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPow
erShell\v1.0;C:\Program Files\Microsoft\Web Platform Installer;C:\Program File
s (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0;C:\Program Files\Microsoft SQL
Server\110\Tools\Binn;C:\Program Files\Perforce;C:\Program Files (x86)\Windows
Kits\8.1\Windows Performance Toolkit;C:\Program Files (x86)\Windows Live\Share
d;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0;C:\Program Files\Microso
ft SQL Server\120\Tools\Binn;C:\Program Files (x86)\SCE\Common\Scream Tool\x86_
dotnet_clr4_release\screamtool_scei;C:\Program Files (x86)\MiKTeX 2.9\miktex\bi
n;E:\Go\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common

@hholst80
Copy link
Author

hholst80 commented Jun 2, 2015

@jgm I would be more comfortable with a simple zip blob I could download and place in E:\pandoc and manually add the PATH myself. Pandoc does not use any registry keys or such? Removing Pandoc from the harddrive would be as easy as removing E:\Pandoc and editing back the PATH variable.

@nkalvi
Copy link

nkalvi commented Jun 2, 2015

@hholst80 Which version of Windows are you on? As I mentioned earlier, you may need to re-login for the path changes take effect in the command window under Windows 8.1; under Windows 7, you need to just start a new command windows.

It is usually installed under <startup disk>\Users\<your username>\AppData\Local\Pandoc\Pandoc.exe.

@hholst80
Copy link
Author

hholst80 commented Jun 2, 2015

Windows 7 Enterprise. Build 7601: Service Pack 1.

Edit: I did try and reboot the computer before I did the where command you suggested.

@nkalvi
Copy link

nkalvi commented Jun 2, 2015

@hholst80 I've tested it under Windows 7 Pro only - where you simply have to close the current command window(s) and start a new one. Path (which defaults to the Pandoc folder user's AppData) will be reflected in the new one. I could test it under Enterprise version later.

@hholst80
Copy link
Author

hholst80 commented Jun 2, 2015

We're using AD (Active Directory) so some user settings might be tweaked by IT guys.

%PATH% contents are shown here #2205 (comment)

@nkalvi
Copy link

nkalvi commented Jun 2, 2015

@hholst80 Ah, I wonder whether custom login script impacts the path. Could you show the path setting under a new command window? (Please remove any sensitive info).

@nkalvi
Copy link

nkalvi commented Jun 2, 2015

@jgm Would this help? https://www.firegiant.com/wix/tutorial/user-interface-revisited/customizations-galore/

I'll take look at the last suggestion as well #1403

@jgm
Copy link
Owner

jgm commented Jun 2, 2015

I know that Windows issues stern warnings for software that
isn't properly signed with a certificate. I sign the msi.
I don't know if this would work with a zip container.

+++ Henrik Holst [Jun 02 15 04:54 ]:

[1]@jgm I would be more comfortable with a simple zip blob I could
download and place in E:\pandoc and manually add the PATH myself.
Pandoc does not use any registry keys or such? Removing Pandoc from the
harddrive would be as easy as removing E:\Pandoc and editing back the
PATH variable.

@nkalvi
Copy link

nkalvi commented Jun 2, 2015

@jgm
This might improve the Windows installer:

I've tested it under Windows 8.1.

References:
https://www.firegiant.com/wix/tutorial/com-expression-syntax-miscellanea/environmentally-friendly/
http://wixtoolset.org/documentation/manual/v3/customactions/wixsettingchange.html

Modification to the make-windows-installer.bat

light  -sw1076 -ext WixUIExtension -ext WixUtilExtension -out pandoc-%VERSION%-windows.msi pandoc.wixobj

pandoc.wxs

<?xml version="1.0"?>
<?define UpgradeCode = "A68E8EF6-ABB1-4F22-A3C5-68DFDF0AB562" ?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id="*"
  UpgradeCode="$(var.UpgradeCode)" Name="Pandoc $(var.VERSION)"
  Version="$(var.VERSION)" Manufacturer="John MacFarlane"
  Language="1033">

    <Package InstallerVersion="200" Compressed="yes" InstallScope="perUser"
    Comments="Windows Installer Package" />
    <Media Id="1" Cabinet="product.cab" EmbedCab="yes" />
    <Property Id="PREVIOUSVERSIONSINSTALLED" Secure="yes" />
    <Upgrade Id="$(var.UpgradeCode)">
      <UpgradeVersion Property='PREVIOUSVERSIONSINSTALLED'
        Minimum='0.0.0.0'  IncludeMinimum='yes'
        Maximum="99.0.0.0" IncludeMaximum="no" />
    </Upgrade>
    <Property Id="ARPURLINFOABOUT" Value="http://johnmacfarlane.net/pandoc/" />

    <InstallExecuteSequence>
      <RemoveExistingProducts After="InstallFinalize"/>
    </InstallExecuteSequence>

    <Property Id="DISABLEADVTSHORTCUTS" Value="1" />

    <CustomAction Id="SetPerUserFolder" Property="APPLICATIONFOLDER" Value="[LocalAppDataFolder]Pandoc" Execute="immediate" />
    <CustomAction Id="SetPerMachineFolder" Property="APPLICATIONFOLDER" Value="[ProgramFilesFolder]Pandoc" Execute="immediate" />
    <InstallExecuteSequence>
      <Custom Action="SetPerUserFolder" Before="CostFinalize">ACTION="INSTALL" AND APPLICATIONFOLDER="" AND (ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged)))</Custom>
      <Custom Action="SetPerMachineFolder" After="SetPerUserFolder">ACTION="INSTALL" AND APPLICATIONFOLDER="" AND (ALLUSERS=1 OR (ALLUSERS=2 AND Privileged))</Custom>
    </InstallExecuteSequence>
    <InstallUISequence>
      <Custom Action="SetPerUserFolder" Before="CostFinalize">ACTION="INSTALL" AND APPLICATIONFOLDER="" AND (ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged)))</Custom>
      <Custom Action="SetPerMachineFolder" After="SetPerUserFolder">ACTION="INSTALL" AND APPLICATIONFOLDER="" AND (ALLUSERS=1 OR (ALLUSERS=2 AND Privileged))</Custom>
    </InstallUISequence>

<CustomActionRef Id="WixBroadcastSettingChange" />
<CustomActionRef Id="WixBroadcastEnvironmentChange" />

    <Directory Id="TARGETDIR" Name="SourceDir">

      <Directory Id="ProgramFilesFolder">
        <Directory Id="APPLICATIONFOLDER" Name="Pandoc">
          <Component Id="MainExecutable"
          Guid="ECD35082-4C28-49E1-977E-B90FC7C400C7">
            <RegistryValue Root="HKMU" Key="Software\John MacFarlane\Pandoc"
            Name="Version" Type="string" Value="[ProductVersion]" KeyPath="yes"/>
            <RemoveFolder Id="APPLICATIONFOLDER" On="uninstall"/>
            <File Id="pandocEXE" Name="pandoc.exe"
            Source="..\.cabal-sandbox\bin\pandoc.exe" />
            <File Id="pandocCOPYRIGHT" Name="COPYRIGHT.txt"
            Source="..\COPYRIGHT.txt" />
            <File Id="pandocCOPYING" Name="COPYING.rtf"
            Source="..\COPYING.rtf" />
          </Component>

          <Component Id="CitationSupport"
          Guid="0A214839-2E69-4026-8DBB-0F0A9DB75C12">
            <RegistryValue Root="HKMU" Key="Software\John MacFarlane\Pandoc"
            Name="Version" Type="string" Value="[ProductVersion]" KeyPath="yes"/>
            <File Id="pandoc_citeprocEXE" Name="pandoc-citeproc.exe"
            Source="..\.cabal-sandbox\bin\pandoc-citeproc.exe" />
          </Component>

<Environment Id='UpdatePath' Name='PATH' Action='set' Permanent='no' System='no' Part='last' Value='[INSTALLDIR]' />

          <Component Id="Documentation"
          Guid="A8D54A76-1A3D-4647-8327-81B69D39D8A3">
            <File Id="pandocREADME" Name="Pandoc User's Guide.html"
            Source="..\README.html" KeyPath="yes">
              <Shortcut Id="ApplicationStartMenuShortcut" Directory="ApplicationProgramsFolder"
              Name="Pandoc User’s Guide" Advertise="yes" />
            </File>
          </Component>
        </Directory>
      </Directory>

      <Directory Id="ProgramMenuFolder">
        <Directory Id="ApplicationProgramsFolder" Name="Pandoc">
          <Component Id="ApplicationShortcut" Guid="7F807DD5-CC54-474A-B571-89630893F563">
            <RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
            <RegistryValue Root="HKMU" Key="Software\John MacFarlane\Pandoc"
            Name="ShortcutInstalled" Type="integer" Value="1" KeyPath="yes"/>
          </Component>
        </Directory>
      </Directory>

    </Directory>

    <Feature Id="Complete" Level="1" Title="Pandoc $(var.VERSION)" Description="Complete package"  Display="expand" ConfigurableDirectory="APPLICATIONFOLDER">
      <Feature Id="MainProgram" Title="Program" Description="The main executable." Level="1">
        <ComponentRef Id="MainExecutable" />
        <ComponentRef Id="UpdatePathUser" />
        <ComponentRef Id="UpdatePathMachine" />
      </Feature>
      <Feature Id="Manual" Title="Manual">
        <ComponentRef Id="Documentation" />
        <ComponentRef Id="ApplicationShortcut" />
      </Feature>
      <Feature Id="Citation" Title="Citation Support" Description="Citation support.">
        <ComponentRef Id="CitationSupport" />
      </Feature>
    </Feature>

    <Property Id="WIXUI_INSTALLDIR" Value="APPLICATIONFOLDER" />
    <UIRef Id="WixUI_InstallDir" />
    <UIRef Id="WixUI_ErrorProgressText" />
    <WixVariable Id="WixUILicenseRtf" Value="..\COPYING.rtf" />

  </Product>
</Wix>

@jgm
Copy link
Owner

jgm commented Jun 2, 2015

Great - I'll try it.

jgm added a commit that referenced this issue Jun 2, 2015
* Allow setting of installation path.
* Use cleaner wix syntax for setting the path:
  https://www.firegiant.com/wix/tutorial/com-expression-syntax-miscellanea/environmentally-friendly/
* Show the user what changes, in a new command window.

See #2205.
@nkalvi
Copy link

nkalvi commented Jun 2, 2015

Worked under Windows 7 Enterprise too:

screen shot 2015-06-02 at 6 20 57 pm

(in a new command window)
screen shot 2015-06-02 at 6 22 41 pm

@nkalvi
Copy link

nkalvi commented Jun 3, 2015

@jgm Could you provide a (signed) package so that @hholst80 could try it?

@jgm
Copy link
Owner

jgm commented Jun 8, 2015

@nkalvi I finally got around to trying this. The build fails with:

pandoc.wxs
... : error CNDL0005 : The Directory element contains an unexpected child element 'Environment'.

I upgraded to the latest version of the WiX toolset, 3.9.1208.0.
???

@nkalvi
Copy link

nkalvi commented Jun 13, 2015

@jgm I apologize for not posting the version I tested.

While the 'Environment' setting compiles fine with 3.9, WixBroadcastSettingChange will not.
Without this setting, under Windows 8.1, one will need to logout out and login again for the path change to be seen.

It looks like WixBroadcastSettingChange was added in v3.10.0.1519: https://www.facebook.com/wixtoolset/posts/953883604656918

BobArnson: WixBroadcastSettingChange and WixBroadcastEnvironmentChange custom actions to WixUtilExtension.

The following compiles fine under WiX version 3.10.0.1726 and works as expected under Windows 8.1; please test it on your system:

<?xml version="1.0"?>
<?define UpgradeCode = "A68E8EF6-ABB1-4F22-A3C5-68DFDF0AB562" ?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id="*"
  UpgradeCode="$(var.UpgradeCode)" Name="Pandoc $(var.VERSION)"
  Version="$(var.VERSION)" Manufacturer="John MacFarlane"
  Language="1033">

    <Package InstallerVersion="200" Compressed="yes" InstallScope="perUser"
    Comments="Windows Installer Package" />
    <Media Id="1" Cabinet="product.cab" EmbedCab="yes" />
    <Property Id="PREVIOUSVERSIONSINSTALLED" Secure="yes" />
    <Upgrade Id="$(var.UpgradeCode)">
      <UpgradeVersion Property='PREVIOUSVERSIONSINSTALLED'
        Minimum='0.0.0.0'  IncludeMinimum='yes'
        Maximum="99.0.0.0" IncludeMaximum="no" />
    </Upgrade>
    <Property Id="ARPURLINFOABOUT" Value="http://pandoc.org" />

    <InstallExecuteSequence>
      <RemoveExistingProducts After="InstallFinalize"/>
    </InstallExecuteSequence>

    <Property Id="DISABLEADVTSHORTCUTS" Value="1" />

    <CustomAction Id="SetPerUserFolder" Property="APPLICATIONFOLDER" Value="[LocalAppDataFolder]Pandoc" Execute="immediate" />
    <CustomAction Id="SetPerMachineFolder" Property="APPLICATIONFOLDER" Value="[ProgramFilesFolder]Pandoc" Execute="immediate" />
    <InstallExecuteSequence>
      <Custom Action="SetPerUserFolder" Before="CostFinalize">ACTION="INSTALL" AND APPLICATIONFOLDER="" AND (ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged)))</Custom>
      <Custom Action="SetPerMachineFolder" After="SetPerUserFolder">ACTION="INSTALL" AND APPLICATIONFOLDER="" AND (ALLUSERS=1 OR (ALLUSERS=2 AND Privileged))</Custom>
    </InstallExecuteSequence>
    <InstallUISequence>
      <Custom Action="SetPerUserFolder" Before="CostFinalize">ACTION="INSTALL" AND APPLICATIONFOLDER="" AND (ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged)))</Custom>
      <Custom Action="SetPerMachineFolder" After="SetPerUserFolder">ACTION="INSTALL" AND APPLICATIONFOLDER="" AND (ALLUSERS=1 OR (ALLUSERS=2 AND Privileged))</Custom>
    </InstallUISequence>


    <Directory Id="TARGETDIR" Name="SourceDir">

      <Directory Id="ProgramFilesFolder">
        <Directory Id="APPLICATIONFOLDER" Name="Pandoc">
          <Component Id="MainExecutable"
          Guid="ECD35082-4C28-49E1-977E-B90FC7C400C7">
            <RegistryValue Root="HKMU" Key="Software\John MacFarlane\Pandoc"
            Name="Version" Type="string" Value="[ProductVersion]" KeyPath="yes"/>
            <RemoveFolder Id="APPLICATIONFOLDER" On="uninstall"/>
            <File Id="pandocEXE" Name="pandoc.exe"
            Source="..\.cabal-sandbox\bin\pandoc.exe" />
            <File Id="pandocCOPYRIGHT" Name="COPYRIGHT.txt"
            Source="..\COPYRIGHT.txt" />
            <File Id="pandocCOPYING" Name="COPYING.rtf"
            Source="..\COPYING.rtf" />
            <Environment Id='UpdatePath' Name='PATH' Action='set' Permanent='no' System='no' Part='last' Value='[APPLICATIONFOLDER]' />
            </Component>

          <Component Id="CitationSupport"
          Guid="0A214839-2E69-4026-8DBB-0F0A9DB75C12">
            <RegistryValue Root="HKMU" Key="Software\John MacFarlane\Pandoc"
            Name="Version" Type="string" Value="[ProductVersion]" KeyPath="yes"/>
            <File Id="pandoc_citeprocEXE" Name="pandoc-citeproc.exe"
            Source="..\.cabal-sandbox\bin\pandoc-citeproc.exe" />
            </Component>


          <Component Id="Documentation"
          Guid="A8D54A76-1A3D-4647-8327-81B69D39D8A3">
            <File Id="pandocREADME" Name="Pandoc User's Guide.html"
            Source="..\README.html" KeyPath="yes">
              <Shortcut Id="ApplicationStartMenuShortcut" Directory="ApplicationProgramsFolder"
              Name="Pandoc User’s Guide" Advertise="yes" />
            </File>
          </Component>
        </Directory>
      </Directory>

      <Directory Id="ProgramMenuFolder">
        <Directory Id="ApplicationProgramsFolder" Name="Pandoc">
          <Component Id="ApplicationShortcut" Guid="7F807DD5-CC54-474A-B571-89630893F563">
            <RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
            <RegistryValue Root="HKMU" Key="Software\John MacFarlane\Pandoc"
            Name="ShortcutInstalled" Type="integer" Value="1" KeyPath="yes"/>
          </Component>
        </Directory>
      </Directory>

    </Directory>

    <Feature Id="Complete" Level="1" Title="Pandoc $(var.VERSION)" Description="Complete package"  Display="expand" ConfigurableDirectory="APPLICATIONFOLDER">
      <Feature Id="MainProgram" Title="Program" Description="The main executable." Level="1">
        <ComponentRef Id="MainExecutable" />
      </Feature>
      <Feature Id="Manual" Title="Manual">
        <ComponentRef Id="Documentation" />
        <ComponentRef Id="ApplicationShortcut" />
      </Feature>
      <Feature Id="Citation" Title="Citation Support" Description="Citation support.">
        <ComponentRef Id="CitationSupport" />
      </Feature>
    </Feature>

    <CustomActionRef Id="WixBroadcastSettingChange" />
    <CustomActionRef Id="WixBroadcastEnvironmentChange" />

    <Property Id="WIXUI_INSTALLDIR" Value="APPLICATIONFOLDER" />
    <UIRef Id="WixUI_InstallDir" />
    <UIRef Id="WixUI_ErrorProgressText" />
    <WixVariable Id="WixUILicenseRtf" Value="..\COPYING.rtf" />

  </Product>
</Wix>

@jgm
Copy link
Owner

jgm commented Jun 13, 2015

Where on earth do you get WiX version 3.10.0.1726?
3.9 is the latest stable release on their website.
I was able to get 3.10.0.1513 through NuGet, but that's not working.

@nkalvi
Copy link

nkalvi commented Jun 13, 2015

@jgm
Copy link
Owner

jgm commented Jun 13, 2015

@nkalvi thanks for the help. I've got it working now.

Some notes from my testing:

  1. It did allow me to specify an installation path. However, when I specified C:\Program Files\Pandoc, it eventually gave me an error, saying that I needed to run the installer with admin privileges. I wonder if there's a way to set it up so it asks the user at the beginning whether to install it for all users, or just for this user? (OSX package installers often give this choice.)
  2. It did change the path, but I had to open a new PowerShell window for the change to be recognized.

@nkalvi
Copy link

nkalvi commented Jun 13, 2015

I'm glad to hear it is working.

  1. WiX has some option related to this - I will check it out and let you know.
  2. It is normal. Only the newly invoked command/power shells will see updates to the path. Informing the user about it would be helpful. It think it is the case in OS X as well, right?

@jgm
Copy link
Owner

jgm commented Jun 13, 2015

+++ nkalvi [Jun 13 15 09:37 ]:

I'm glad to hear it is working.

  1. WiX has some option related to this - I will check it out and let
    you know.
  2. It is normal. Only the newly invoked command/power shells will see
    updates to the path. Informing the user about it would be helpful.
    It think it is the case in OS X as well, right?

Yes, I think so.

@jgm jgm closed this as completed Jun 14, 2015
@nkalvi
Copy link

nkalvi commented Jun 15, 2015

@jgm
Here’s a possible solution to 1) above.

  1. Default is simple installation - “per user” install - selecting the location is not offered.
  2. Offers ‘Advanced’ option for customization.
    screen shot 2015-06-15 at 9 19 39 am
    screen shot 2015-06-15 at 9 20 13 am
  3. Summary shows installed location and hint about restarting command windows.
    screen shot 2015-06-15 at 10 02 37 am
  4. Minor enhancement - add installed location which can be viewed in Add/Remove Programs.
    screen shot 2015-06-15 at 10 06 27 am

I’ve tested this under Windows 7 & 8.1.
Please take a look when you have time.

References:

pandoc.wxs

<?xml version="1.0"?>
<?define UpgradeCode = "A68E8EF6-ABB1-4F22-A3C5-68DFDF0AB562" ?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id="*"
  UpgradeCode="$(var.UpgradeCode)" Name="Pandoc $(var.VERSION)"
  Version="$(var.VERSION)" Manufacturer="John MacFarlane"
  Language="1033">

    <Package InstallerVersion="200" Compressed="yes"
    Comments="Windows Installer Package" />
    <Media Id="1" Cabinet="product.cab" EmbedCab="yes" />
    <Property Id="PREVIOUSVERSIONSINSTALLED" Secure="yes" />
    <Upgrade Id="$(var.UpgradeCode)">
      <UpgradeVersion Property='PREVIOUSVERSIONSINSTALLED'
        Minimum='0.0.0.0'  IncludeMinimum='yes'
        Maximum="99.0.0.0" IncludeMaximum="no" />
    </Upgrade>
    <Property Id="ARPURLINFOABOUT" Value="http://pandoc.org" />

    <InstallExecuteSequence>
      <RemoveExistingProducts After="InstallFinalize"/>
    </InstallExecuteSequence>

    <Property Id="DISABLEADVTSHORTCUTS" Value="1" />


    <Directory Id="TARGETDIR" Name="SourceDir">

      <Directory Id="ProgramFilesFolder">
        <Directory Id="APPLICATIONFOLDER" Name="Pandoc">
          <Component Id="MainExecutable"
          Guid="ECD35082-4C28-49E1-977E-B90FC7C400C7">
            <RegistryValue Root="HKMU" Key="Software\John MacFarlane\Pandoc"
            Name="Version" Type="string" Value="[ProductVersion]" KeyPath="yes"/>
            <RemoveFolder Id="APPLICATIONFOLDER" On="uninstall"/>
            <File Id="pandocEXE" Name="pandoc.exe"
            Source="..\.cabal-sandbox\bin\pandoc.exe" />
            <File Id="pandocCOPYRIGHT" Name="COPYRIGHT.txt"
            Source="..\COPYRIGHT.txt" />
            <File Id="pandocCOPYING" Name="COPYING.rtf"
            Source="..\COPYING.rtf" />
            <Environment Id='UpdatePath' Name='PATH' Action='set' Permanent='no' System='no' Part='last' Value='[APPLICATIONFOLDER]' />
            </Component>

          <Component Id="CitationSupport"
          Guid="0A214839-2E69-4026-8DBB-0F0A9DB75C12">
            <RegistryValue Root="HKMU" Key="Software\John MacFarlane\Pandoc"
            Name="Version" Type="string" Value="[ProductVersion]" KeyPath="yes"/>
            <File Id="pandoc_citeprocEXE" Name="pandoc-citeproc.exe"
            Source="..\.cabal-sandbox\bin\pandoc-citeproc.exe" />
            </Component>


          <Component Id="Documentation"
          Guid="A8D54A76-1A3D-4647-8327-81B69D39D8A3">
            <File Id="pandocREADME" Name="Pandoc User's Guide.html"
            Source="..\README.html" KeyPath="yes">
              <Shortcut Id="ApplicationStartMenuShortcut" Directory="ApplicationProgramsFolder"
              Name="Pandoc User’s Guide" Advertise="yes" />
            </File>
          </Component>
        </Directory>
      </Directory>

      <Directory Id="ProgramMenuFolder">
        <Directory Id="ApplicationProgramsFolder" Name="Pandoc">
          <Component Id="ApplicationShortcut" Guid="7F807DD5-CC54-474A-B571-89630893F563">
            <RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
            <RegistryValue Root="HKMU" Key="Software\John MacFarlane\Pandoc"
            Name="ShortcutInstalled" Type="integer" Value="1" KeyPath="yes"/>
          </Component>
        </Directory>
      </Directory>

    </Directory>

    <Feature Id="Complete" Level="1" Title="Pandoc $(var.VERSION)" Description="Complete package"  Display="expand" ConfigurableDirectory="APPLICATIONFOLDER">
      <Feature Id="MainProgram" Title="Program" Description="The main executable." Level="1">
        <ComponentRef Id="MainExecutable" />
      </Feature>
      <Feature Id="Manual" Title="Manual">
        <ComponentRef Id="Documentation" />
        <ComponentRef Id="ApplicationShortcut" />
      </Feature>
      <Feature Id="Citation" Title="Citation Support" Description="Citation support.">
        <ComponentRef Id="CitationSupport" />
      </Feature>
    </Feature>


    <SetProperty Id="ARPINSTALLLOCATION" Value="[APPLICATIONFOLDER]"
                    After="CostFinalize" />

    <CustomAction Id="SetExitDialogOptText"
      Property="WIXUI_EXITDIALOGOPTIONALTEXT"
      Value="[ProductName] was installed in [APPLICATIONFOLDER]. You may need to restart Cmd/Powershell windows before using it."
     />

    <InstallUISequence>
        <Custom Action="SetExitDialogOptText" Before="ExecuteAction">
             NOT Installed
        </Custom>
    </InstallUISequence>

    <CustomActionRef Id="WixBroadcastSettingChange" />
    <CustomActionRef Id="WixBroadcastEnvironmentChange" />



    <Property Id="ApplicationFolderName" Value="Pandoc" />
    <Property Id="WixAppFolder" Value="WixPerUserFolder" />

    <WixVariable Id="WixUILicenseRtf" Value="..\COPYING.rtf" />

    <UI Id="MyWixUI_Advanced">
            <UIRef Id="WixUI_Advanced" />
            <UIRef Id="WixUI_ErrorProgressText" />

            <Publish Dialog="InstallScopeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="6">WixAppFolder = "WixPerUserFolder"</Publish>
            <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"</Publish>

            <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="InstallScopeDlg" Order="11">WixAppFolder = "WixPerUserFolder"</Publish>
            <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="InstallDirDlg" Order="12">WixAppFolder = "WixPerMachineFolder"</Publish>
    </UI>


  </Product>

  </Wix>

jgm added a commit that referenced this issue Jun 28, 2015
This should allow the user to select a per-user or systemwide install.
It also shows install location in the list of installed programs.

Thanks to @nkalvi.
See #2205.
@jgm
Copy link
Owner

jgm commented Jun 28, 2015

@nkalvi I haven't tried this myself, but Cesar Romani reports this on pandoc-discuss:

Even with the last WiX toolset I get:

[...]
Windows Installer XML Toolset Linker version 3.10.0.1726
Copyright (c) Outercurve Foundation. All rights reserved.

c:\home\caesar\pandoc\windows\pandoc.wxs(121) : error LGHT0094 : Unresolved
reference to symbol 'CustomAction:WixBroadcastSettingChange' in section
'Product:*'.
c:\home\caesar\pandoc\windows\pandoc.wxs(122) : error LGHT0094 : Unresolved
reference to symbol 'CustomAction:WixBroadcastEnvironmentChange' in section
'Product:*'.

Any ideas?

@nkalvi
Copy link

nkalvi commented Jun 28, 2015

@jgm I'll look into it now.

@nkalvi
Copy link

nkalvi commented Jun 29, 2015

@jgm I'm getting the following error while trying to build the development version under Windows 8.1; I'm missing a step? I've updated pandoc-types.

Building pandoc-1.14.1...
Preprocessing library pandoc-1.14.1...
[24 of 76] Compiling Text.Pandoc.Shared ( src\Text\Pandoc\Shared.hs, dist\dist-sandbox-cb1f11db\build\Text\Pandoc\Shared.o )

src\Text\Pandoc\Shared.hs:135:37:
    Module `Text.Pandoc.Data' does not export `readmeFile'

@nkalvi
Copy link

nkalvi commented Jun 29, 2015

@jgm Just posted a reply to Cesar on discuss; didn't get any errors.

@jgm
Copy link
Owner

jgm commented Jun 29, 2015

+++ nkalvi [Jun 28 15 17:04 ]:

[1]@jgm I'm getting the following error while trying to build the
development version under Windows 8.1; I'm missing a step? I've updated
pandoc-types.

No, I made some changes and didn't test with
embed_data_files. I'll push a fix soon.

@nkalvi
Copy link

nkalvi commented Jun 29, 2015

Thanks @jgm.
I'll continue testing with 1.14.0.4, but with the updated pandoc.wxs and make-windows-installer.bat.

When testing, I didn't get the 'unresolved symbol' error, but I got another error with the pandoc.wxs:

AppData\Local\Temp\jhhzdegi\Registry.idt : error LGHT0136 : There was an error importing table 'Registry' from file 'C:\Users\nkalvi\AppData\Local\Temp\jhhzdegi\Registry.idt'.

The one I posted (https://gist.github.com/nkalvi/738e8411f26ea6c2a6ba) works fine.
So I wonder whether line breaks inside the lines with registry entries are causing it.
Could you please change those lines? I will test it again after you've updated it.

jgm added a commit that referenced this issue Jun 29, 2015
@nkalvi
Copy link

nkalvi commented Jun 29, 2015

Registry related error is gone now (tested under Windows 8.1 with WiX 3.10.0.1823).

@jgm
Copy link
Owner

jgm commented Jun 29, 2015

I was able to generate a working installer just now.
One thing I noticed: previously the installer put pandoc.exe in HOME\AppData\Local\Pandoc; now it puts it in HOME\AppData\Local\Apps\Pandoc. Since the path is updated by appending (rather than prepending), anyone who used the old installer will have the old location in their path, ahead of the new location. So if they use pandoc on the command line, the old version will be used and they may not realize this.
Of course, they should be able to remove the old version easily enough, though the Control Panel. So maybe this isn't a huge problem, but I thought I'd point it out.

@nkalvi
Copy link

nkalvi commented Jun 29, 2015

I'm glad to hear that there weren't any glitches this time.

One thing I noticed: previously the installer put pandoc.exe in HOME\AppData\Local\Pandoc; now it puts it in HOME\AppData\Local\Apps\Pandoc.

It was an indirect change due to WixUI_Advanced; this version sets the location to AppData\Local\Pandoc: https://gist.github.com/nkalvi/28553159cb92a363ea6b
with this update:

    <CustomAction Id="CustomWixSetPerUserFolder" Property="APPLICATIONFOLDER" Value="[LocalAppDataFolder][ApplicationFolderName]" Execute="immediate" />

    <InstallExecuteSequence>
        <Custom Action="CustomWixSetPerUserFolder" After="WixSetPerUserFolder">
            ACTION="INSTALL" AND (ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged)))
        </Custom>
    </InstallExecuteSequence>

    <InstallUISequence>
        <Custom Action="SetExitDialogOptText" Before="ExecuteAction">
             NOT Installed
        </Custom>
        <Custom Action="CustomWixSetPerUserFolder" After="WixSetPerUserFolder">
            ACTION="INSTALL" AND (ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged)))
        </Custom>
    </InstallUISequence>

I have tested the change on my system.


Reference (please take a look when you have time):
http://sourceforge.net/p/wix/feature-requests/656/

Software should never ever be installed in [LocalAppDataFolder]. It need to be installed in [AppDataFolder] as this is the only folder that is kept in Roaming Profile environments.

@jgm
Copy link
Owner

jgm commented Jun 29, 2015

Thanks, I've pushed this change.

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

No branches or pull requests

3 participants