ollama.iss 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. ; Inno Setup Installer for Ollama
  2. ;
  3. ; To build the installer use the build script invoked from the top of the source tree
  4. ;
  5. ; powershell -ExecutionPolicy Bypass -File .\scripts\build_windows.ps
  6. #define MyAppName "Ollama"
  7. #if GetEnv("PKG_VERSION") != ""
  8. #define MyAppVersion GetEnv("PKG_VERSION")
  9. #else
  10. #define MyAppVersion "0.0.0"
  11. #endif
  12. #define MyAppPublisher "Ollama"
  13. #define MyAppURL "https://ollama.com/"
  14. #define MyAppExeName "ollama app.exe"
  15. #define MyIcon ".\assets\app.ico"
  16. [Setup]
  17. ; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
  18. ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
  19. AppId={{44E83376-CE68-45EB-8FC1-393500EB558C}
  20. AppName={#MyAppName}
  21. AppVersion={#MyAppVersion}
  22. VersionInfoVersion={#MyAppVersion}
  23. ;AppVerName={#MyAppName} {#MyAppVersion}
  24. AppPublisher={#MyAppPublisher}
  25. AppPublisherURL={#MyAppURL}
  26. AppSupportURL={#MyAppURL}
  27. AppUpdatesURL={#MyAppURL}
  28. ArchitecturesAllowed=x64
  29. ArchitecturesInstallIn64BitMode=x64
  30. DefaultDirName={localappdata}\Programs\{#MyAppName}
  31. DefaultGroupName={#MyAppName}
  32. DisableProgramGroupPage=yes
  33. PrivilegesRequired=lowest
  34. OutputBaseFilename="OllamaSetup"
  35. SetupIconFile={#MyIcon}
  36. UninstallDisplayIcon={uninstallexe}
  37. Compression=lzma2
  38. SolidCompression=no
  39. WizardStyle=modern
  40. ChangesEnvironment=yes
  41. OutputDir=..\dist\
  42. ; Disable logging once everything's battle tested
  43. ; Filename will be %TEMP%\Setup Log*.txt
  44. SetupLogging=yes
  45. CloseApplications=yes
  46. RestartApplications=no
  47. ; Make sure they can at least download llama2 as a minimum
  48. ExtraDiskSpaceRequired=3826806784
  49. ; https://jrsoftware.org/ishelp/index.php?topic=setup_wizardimagefile
  50. WizardSmallImageFile=.\assets\setup.bmp
  51. ; TODO verifty actual min windows version...
  52. ; OG Win 10
  53. MinVersion=10.0.10240
  54. ; First release that supports WinRT UI Composition for win32 apps
  55. ; MinVersion=10.0.17134
  56. ; First release with XAML Islands - possible UI path forward
  57. ; MinVersion=10.0.18362
  58. ; quiet...
  59. DisableDirPage=yes
  60. DisableFinishedPage=yes
  61. DisableReadyMemo=yes
  62. DisableReadyPage=yes
  63. DisableStartupPrompt=yes
  64. DisableWelcomePage=yes
  65. ; TODO - percentage can't be set less than 100, so how to make it shorter?
  66. ; WizardSizePercent=100,80
  67. #if GetEnv("KEY_CONTAINER")
  68. SignTool=MySignTool
  69. SignedUninstaller=yes
  70. #endif
  71. [Languages]
  72. Name: "english"; MessagesFile: "compiler:Default.isl"
  73. [LangOptions]
  74. DialogFontSize=12
  75. [Files]
  76. Source: ".\app.exe"; DestDir: "{app}"; DestName: "{#MyAppExeName}" ; Flags: ignoreversion 64bit
  77. Source: "..\ollama.exe"; DestDir: "{app}"; Flags: ignoreversion 64bit
  78. Source: "..\dist\windeps\*.dll"; DestDir: "{app}"; Flags: ignoreversion 64bit
  79. Source: "..\dist\ollama_welcome.ps1"; DestDir: "{app}"; Flags: ignoreversion
  80. Source: ".\assets\app.ico"; DestDir: "{app}"; Flags: ignoreversion
  81. [Icons]
  82. Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\app.ico"
  83. Name: "{userstartup}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\app.ico"
  84. Name: "{userprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\app.ico"
  85. [Run]
  86. Filename: "{cmd}"; Parameters: "/C set PATH={app};%PATH% & ""{app}\{#MyAppExeName}"""; Flags: postinstall nowait runhidden
  87. [UninstallRun]
  88. ; Filename: "{cmd}"; Parameters: "/C ""taskkill /im ''{#MyAppExeName}'' /f /t"; Flags: runhidden
  89. ; Filename: "{cmd}"; Parameters: "/C ""taskkill /im ollama.exe /f /t"; Flags: runhidden
  90. Filename: "taskkill"; Parameters: "/im ""{#MyAppExeName}"" /f /t"; Flags: runhidden
  91. Filename: "taskkill"; Parameters: "/im ""ollama.exe"" /f /t"; Flags: runhidden
  92. ; HACK! need to give the server and app enough time to exit
  93. ; TODO - convert this to a Pascal code script so it waits until they're no longer running, then completes
  94. Filename: "{cmd}"; Parameters: "/c timeout 5"; Flags: runhidden
  95. [UninstallDelete]
  96. Type: filesandordirs; Name: "{%TEMP}\ollama*"
  97. Type: filesandordirs; Name: "{%LOCALAPPDATA}\Ollama"
  98. Type: filesandordirs; Name: "{%LOCALAPPDATA}\Programs\Ollama"
  99. Type: filesandordirs; Name: "{%USERPROFILE}\.ollama"
  100. ; NOTE: if the user has a custom OLLAMA_MODELS it will be preserved
  101. [Messages]
  102. WizardReady=Welcome to Ollama Windows Preview
  103. ReadyLabel1=%nLet's get you up and running with your own large language models.
  104. ;ReadyLabel2b=We'll be installing Ollama in your user account without requiring Admin permissions
  105. ;FinishedHeadingLabel=Run your first model
  106. ;FinishedLabel=%nRun this command in a PowerShell or cmd terminal.%n%n%n ollama run llama2
  107. ;ClickFinish=%n
  108. [Registry]
  109. Root: HKCU; Subkey: "Environment"; \
  110. ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}"; \
  111. Check: NeedsAddPath('{app}')
  112. [Code]
  113. function NeedsAddPath(Param: string): boolean;
  114. var
  115. OrigPath: string;
  116. begin
  117. if not RegQueryStringValue(HKEY_CURRENT_USER,
  118. 'Environment',
  119. 'Path', OrigPath)
  120. then begin
  121. Result := True;
  122. exit;
  123. end;
  124. { look for the path with leading and trailing semicolon }
  125. { Pos() returns 0 if not found }
  126. Result := Pos(';' + ExpandConstant(Param) + ';', ';' + OrigPath + ';') = 0;
  127. end;