_TODO.txt 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. TODO
  2. 1. Determine Package Use:
  3. Organization? Internal Use? - You are not subject to distribution
  4. rights when you keep everything internal. Put the binaries directly
  5. into the tools directory (as long as total nupkg size is under 1GB).
  6. When bigger, look to use from a share or download binaries from an
  7. internal location. Embedded binaries makes for the most reliable use
  8. of Chocolatey. Use `$fileLocation` (`$file`/`$file64`) and
  9. `Install-ChocolateyInstallPackage`/`Get-ChocolateyUnzip` in
  10. tools\chocolateyInstall.ps1.
  11. You can also choose to download from internal urls, see the next
  12. section, but ignore whether you have distribution rights or not, it
  13. doesn't apply. Under no circumstances should download from the
  14. internet, it is completely unreliable. See
  15. https://docs.chocolatey.org/en-us/community-repository/community-packages-disclaimer
  16. to understand the limitations of a publicly available repository.
  17. Community Repository?
  18. Have Distribution Rights?
  19. If you are the software vendor OR the software EXPLICITLY allows
  20. redistribution and the total nupkg size will be under 200MB, you
  21. have the option to embed the binaries directly into the package to
  22. provide the most reliable install experience. Put the binaries
  23. directly into the tools folder, use `$fileLocation` (`$file`/
  24. `$file64`) and `Install-ChocolateyInstallPackage`/
  25. `Get-ChocolateyUnzip` in tools\chocolateyInstall.ps1. Additionally,
  26. fill out the LICENSE and VERIFICATION file (see 3 below and those
  27. files for specifics).
  28. NOTE: You can choose to download binaries at runtime, but be sure
  29. the download location will remain stable. See the next section.
  30. Do Not Have Distribution Rights?
  31. - Note: Packages built this way cannot be 100% reliable, but it's a
  32. constraint of publicly available packages and there is little
  33. that can be done to change that. See
  34. https://docs.chocolatey.org/en-us/community-repository/community-packages-disclaimer
  35. to better understand the limitations of a publicly available
  36. repository.
  37. Download Location is Publicly Available?
  38. You will need to download the runtime files from their official
  39. location at runtime. Use `$url`/`$url64` and
  40. `Install-ChocolateyPackage`/`Install-ChocolateyZipPackage` in
  41. tools\chocolateyInstall.ps1.
  42. Download Location is Not Publicly Available?
  43. Stop here, you can't push this to the community repository. You
  44. can ask the vendor for permission to embed, then include a PDF of
  45. that signed permission directly in the package. Otherwise you
  46. will need to seek alternate locations to non-publicly host the
  47. package.
  48. Download Location Is Same For All Versions?
  49. You still need to point to those urls, but you may wish to set up
  50. something like Automatic Updater (AU) so that when a new version
  51. of the software becomes available, the new package version
  52. automatically gets pushed up to the community repository. See
  53. https://docs.chocolatey.org/en-us/create/automatic-packages#automatic-updater-au
  54. 2. Determine Package Type:
  55. - Installer Package - contains an installer (everything in template is
  56. geared towards this type of package)
  57. - Zip Package - downloads or embeds and unpacks archives, may unpack
  58. and run an installer using `Install-ChocolateyInstallPackage` as a
  59. secondary step.
  60. - Portable Package - Contains runtime binaries (or unpacks them as a
  61. zip package) - cannot require administrative permissions to install
  62. or use
  63. - Config Package - sets config like files, registry keys, etc
  64. - Extension Package - Packages that add PowerShell functions to
  65. Chocolatey - https://docs.chocolatey.org/en-us/features/extensions
  66. - Template Package - Packages that add templates like this for `choco
  67. new -t=name` - https://docs.chocolatey.org/en-us/guides/create/create-custom-package-templates
  68. - Other - there are other types of packages as well, these are the main
  69. package types seen in the wild
  70. 3. Fill out the package contents:
  71. - tools\chocolateyBeforeModify.ps1 - remove if you have no processes
  72. or services to shut down before upgrade/uninstall
  73. - tools\LICENSE.txt / tools\VERIFICATION.txt - Remove if you are not
  74. embedding binaries. Keep and fill out if you are embedding binaries
  75. in the package AND pushing to the community repository, even if you
  76. are the author of software. The file becomes easier to fill out
  77. (does not require changes each version) if you are the software
  78. vendor. If you are building packages for internal use (organization,
  79. etc), you don't need these files as you are not subject to
  80. distribution rights internally.
  81. - tools\chocolateyUninstall.ps1 - remove if autouninstaller can
  82. automatically uninstall and you have nothing additional to do during
  83. uninstall
  84. - Readme.txt - delete this file once you have read over and used
  85. anything you've needed from here
  86. - nuspec - fill this out, then clean out all the comments (you may wish
  87. to leave the headers for the package vs software metadata)
  88. - tools\chocolateyInstall.ps1 - instructions in next section.
  89. 4. ChocolateyInstall.ps1:
  90. - For embedded binaries - use `$fileLocation` (`$file`/`$file64`) and
  91. `Install-ChocolateyInstallPackage`/ `Get-ChocolateyUnzip`.
  92. - Downloading binaries at runtime - use `$url`/`$url64` and
  93. `Install-ChocolateyPackage` / `Install-ChocolateyZipPackage`.
  94. - Other needs (creating files, setting registry keys), use regular
  95. PowerShell to do so or see if there is a function already defined:
  96. https://docs.chocolatey.org/en-us/create/functions
  97. - There may also be functions available in extension packages, see
  98. https://community.chocolatey.org/packages?q=id%3A.extension for examples and
  99. availability.
  100. - Clean out the comments and sections you are not using.
  101. 5. Test the package to ensure install/uninstall work appropriately.
  102. There is a test environment you can use for this -
  103. https://github.com/chocolatey/chocolatey-test-environment
  104. 6. Learn more about Chocolatey packaging - go through the workshop at
  105. https://github.com/chocolatey/chocolatey-workshop
  106. You will learn about
  107. - General packaging
  108. - Customizing package behavior at runtime (package parameters)
  109. - Extension packages
  110. - Custom packaging templates
  111. - Setting up an internal Chocolatey.Server repository
  112. - Adding and using internal repositories
  113. - Reporting
  114. - Advanced packaging techniques when installers are not friendly to
  115. automation
  116. 7. Delete this file.