ollama.iss 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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 arm64
  29. ArchitecturesInstallIn64BitMode=x64 arm64
  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. ; https://jrsoftware.org/ishelp/index.php?topic=setup_wizardimagefile
  48. WizardSmallImageFile=.\assets\setup.bmp
  49. ; TODO verifty actual min windows version...
  50. ; OG Win 10
  51. MinVersion=10.0.10240
  52. ; First release that supports WinRT UI Composition for win32 apps
  53. ; MinVersion=10.0.17134
  54. ; First release with XAML Islands - possible UI path forward
  55. ; MinVersion=10.0.18362
  56. ; quiet...
  57. DisableDirPage=yes
  58. DisableFinishedPage=yes
  59. DisableReadyMemo=yes
  60. DisableReadyPage=yes
  61. DisableStartupPrompt=yes
  62. DisableWelcomePage=yes
  63. ; TODO - percentage can't be set less than 100, so how to make it shorter?
  64. ; WizardSizePercent=100,80
  65. #if GetEnv("KEY_CONTAINER")
  66. SignTool=MySignTool
  67. SignedUninstaller=yes
  68. #endif
  69. SetupMutex=OllamaSetupMutex
  70. [Languages]
  71. Name: "english"; MessagesFile: "compiler:Default.isl"
  72. [LangOptions]
  73. DialogFontSize=12
  74. [Files]
  75. Source: ".\app.exe"; DestDir: "{app}"; DestName: "{#MyAppExeName}" ; Flags: ignoreversion 64bit
  76. Source: "..\ollama.exe"; DestDir: "{app}"; Flags: ignoreversion 64bit
  77. Source: "..\dist\windows-{#ARCH}\*.dll"; DestDir: "{app}"; Flags: ignoreversion 64bit
  78. Source: "..\dist\windows-{#ARCH}\ollama_runners\*"; DestDir: "{app}\ollama_runners"; Flags: ignoreversion 64bit recursesubdirs
  79. Source: "..\dist\ollama_welcome.ps1"; DestDir: "{app}"; Flags: ignoreversion
  80. Source: ".\assets\app.ico"; DestDir: "{app}"; Flags: ignoreversion
  81. #if DirExists("..\dist\windows-amd64\rocm")
  82. Source: "..\dist\windows-amd64\rocm\*"; DestDir: "{app}\rocm\"; Flags: ignoreversion recursesubdirs
  83. #endif
  84. [Icons]
  85. Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\app.ico"
  86. Name: "{userstartup}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\app.ico"
  87. Name: "{userprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\app.ico"
  88. [Run]
  89. Filename: "{cmd}"; Parameters: "/C set PATH={app};%PATH% & ""{app}\{#MyAppExeName}"""; Flags: postinstall nowait runhidden
  90. [UninstallRun]
  91. ; Filename: "{cmd}"; Parameters: "/C ""taskkill /im ''{#MyAppExeName}'' /f /t"; Flags: runhidden
  92. ; Filename: "{cmd}"; Parameters: "/C ""taskkill /im ollama.exe /f /t"; Flags: runhidden
  93. Filename: "taskkill"; Parameters: "/im ""{#MyAppExeName}"" /f /t"; Flags: runhidden
  94. Filename: "taskkill"; Parameters: "/im ""ollama.exe"" /f /t"; Flags: runhidden
  95. ; HACK! need to give the server and app enough time to exit
  96. ; TODO - convert this to a Pascal code script so it waits until they're no longer running, then completes
  97. Filename: "{cmd}"; Parameters: "/c timeout 5"; Flags: runhidden
  98. [UninstallDelete]
  99. Type: filesandordirs; Name: "{%TEMP}\ollama*"
  100. Type: filesandordirs; Name: "{%LOCALAPPDATA}\Ollama"
  101. Type: filesandordirs; Name: "{%LOCALAPPDATA}\Programs\Ollama"
  102. Type: filesandordirs; Name: "{%USERPROFILE}\.ollama\models"
  103. Type: filesandordirs; Name: "{%USERPROFILE}\.ollama\history"
  104. ; NOTE: if the user has a custom OLLAMA_MODELS it will be preserved
  105. [Messages]
  106. WizardReady=Ollama Windows Preview
  107. ReadyLabel1=%nLet's get you up and running with your own large language models.
  108. SetupAppRunningError=Another Ollama installer is running.%n%nPlease cancel or finish the other installer, then click OK to continue with this install, or Cancel to exit.
  109. ;FinishedHeadingLabel=Run your first model
  110. ;FinishedLabel=%nRun this command in a PowerShell or cmd terminal.%n%n%n ollama run llama3
  111. ;ClickFinish=%n
  112. [Registry]
  113. Root: HKCU; Subkey: "Environment"; \
  114. ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}"; \
  115. Check: NeedsAddPath('{app}')
  116. [Code]
  117. function NeedsAddPath(Param: string): boolean;
  118. var
  119. OrigPath: string;
  120. begin
  121. if not RegQueryStringValue(HKEY_CURRENT_USER,
  122. 'Environment',
  123. 'Path', OrigPath)
  124. then begin
  125. Result := True;
  126. exit;
  127. end;
  128. { look for the path with leading and trailing semicolon }
  129. { Pos() returns 0 if not found }
  130. Result := Pos(';' + ExpandConstant(Param) + ';', ';' + OrigPath + ';') = 0;
  131. end;