-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoffline-installer.html
More file actions
408 lines (389 loc) · 23.9 KB
/
offline-installer.html
File metadata and controls
408 lines (389 loc) · 23.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>PostgreSQL Offline Installer for Windows — Full Setup Without Internet</title>
<meta name="description" content="Install PostgreSQL on Windows 10/11 without internet access. Download the full 64-bit installer, transfer via USB, run offline, verify psql, and finish setup." />
<link rel="canonical" href="https://postgre-sql.github.io/offline-installer.html" />
<meta name="last-modified" content="2026-05-01T13:06:51Z" />
<meta name="robots" content="index,follow" />
<meta name="theme-color" content="#336791" />
<!-- Open Graph -->
<meta property="og:type" content="article" />
<meta property="og:title" content="PostgreSQL Offline Installer for Windows — Full Setup Without Internet" />
<meta property="og:description" content="Install PostgreSQL on Windows 10/11 with no internet: use the full installer, transfer, run offline, and verify." />
<meta property="og:url" content="https://postgre-sql.github.io/offline-installer.html" />
<meta property="og:site_name" content="PostgreSQL for Windows" />
<meta property="og:image" content="https://postgre-sql.github.io/og-image.png" />
<!-- Twitter -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="PostgreSQL Offline Installer for Windows" />
<meta name="twitter:description" content="Full offline setup for Windows 10/11 with the verified 64-bit installer." />
<meta name="twitter:image" content="https://postgre-sql.github.io/og-image.png" />
<!-- Icons -->
<link rel="icon" href="https://postgre-sql.github.io/favicon.svg" type="image/svg+xml" />
<link rel="alternate icon" href="https://postgre-sql.github.io/favicon.ico" />
<link rel="apple-touch-icon" href="https://postgre-sql.github.io/apple-touch-icon.png" />
<style>
:root{
--bg:#F8FAFC; --panel:#FFFFFF; --text:#0F172A; --muted:#334155; --primary:#336791; --primary-600:#2b5a75; --primary-700:#244a60; --accent:#3E7BB6; --success:#2F855A; --warning:#B7791F; --border:#E2E8F0; --focus:#F59E0B; --shadow:0 2px 10px rgba(15,23,42,.08);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0; color:var(--text); background:var(--bg); font:16px/1.55 system-ui,-apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji"}
a{color:var(--primary)}
a:focus, button:focus{outline:3px solid var(--focus); outline-offset:2px}
header{position:sticky; top:0; z-index:50; background:rgba(255,255,255,.9); backdrop-filter:saturate(180%) blur(8px); border-bottom:1px solid var(--border)}
.wrap{max-width:1100px; margin:0 auto; padding:0 16px}
.topbar{display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 0}
.brand{display:flex; align-items:center; gap:10px; color:var(--primary-700); text-decoration:none; font-weight:700}
.brand svg{width:28px;height:28px}
nav ul{list-style:none; margin:0; padding:0; display:flex; gap:14px; flex-wrap:wrap}
nav a{display:inline-flex; align-items:center; gap:6px; text-decoration:none; color:var(--muted); padding:8px 10px; border-radius:8px}
nav a:hover{background:#eef2f7; color:var(--primary-700)}
.breadcrumbs{font-size:14px; color:var(--muted); padding:10px 0}
.breadcrumbs a{text-decoration:none; color:inherit}
.hero{background:linear-gradient(180deg, #fff 0%, #f3f7fb 100%); border-bottom:1px solid var(--border)}
.hero .inner{display:grid; grid-template-columns:1.1fr .9fr; gap:24px; padding:34px 0}
.hero h1{font-size:clamp(26px,3.3vw,38px); line-height:1.15; margin:8px 0 10px}
.hero p.sub{color:var(--muted); margin:0 0 18px}
.btn{appearance:none; border:0; border-radius:10px; padding:12px 16px; display:inline-flex; align-items:center; gap:10px; cursor:pointer; font-weight:700; text-decoration:none}
.btn-primary{background:var(--primary); color:#fff}
.btn-primary:hover{background:var(--primary-600)}
.btn-ghost{background:transparent; color:var(--primary-700); border:2px solid var(--primary-600)}
.btn-ghost:hover{background:#e8f0f9}
.cta-row{display:flex; gap:12px; flex-wrap:wrap}
.note{display:flex; align-items:center; gap:8px; color:var(--muted); font-size:14px; margin-top:10px}
.section{padding:30px 0}
.section h2{margin:0 0 14px; font-size:22px}
.card-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:16px}
.card{background:var(--panel); border:1px solid var(--border); border-radius:14px; padding:16px; box-shadow:var(--shadow)}
.card h3{margin:0 0 8px; font-size:18px}
.card p{margin:0; color:var(--muted)}
.list{margin:10px 0 0; padding-left:18px}
footer{margin-top:24px; border-top:1px solid var(--border); background:#fff}
.footer-inner{display:grid; grid-template-columns:1fr 1fr; gap:16px; padding:18px 0}
.muted{color:var(--muted)}
.disclaimer{background:#fff; border:1px dashed var(--border); padding:14px; border-radius:12px; color:var(--muted)}
.mobile-cta{position:fixed; bottom:12px; left:12px; right:12px; display:none; z-index:30}
.mobile-cta .inner{background:#10263a; border-radius:14px; padding:10px; display:flex; justify-content:space-between; align-items:center; gap:10px; color:#e6f1fa; box-shadow:0 8px 22px rgba(0,0,0,.25)}
.mobile-cta .inner .btn{padding:10px 14px}
/* Cookie banner */
.cookie-banner{position:fixed; z-index:60; inset:auto 12px 12px 12px; background:#fff; border:1px solid var(--border); border-radius:14px; box-shadow:var(--shadow); display:none}
.cookie-content{padding:14px; display:grid; grid-template-columns:1fr auto; gap:12px; align-items:start}
.cookie-actions{display:flex; gap:8px; flex-wrap:wrap}
.cookie-banner .btn{padding:10px 12px}
/* Responsive */
@media (max-width: 900px){
.hero .inner{grid-template-columns:1fr}
.card-grid{grid-template-columns:1fr 1fr}
.footer-inner{grid-template-columns:1fr}
}
@media (max-width: 640px){
.card-grid{grid-template-columns:1fr}
.mobile-cta{display:block}
}
</style>
<!-- SVG Sprite -->
<svg xmlns="http://www.w3.org/2000/svg" style="position:absolute;width:0;height:0;overflow:hidden" aria-hidden="true">
<symbol id="icon-download" viewBox="0 0 24 24" fill="currentColor">
<path d="M12 3a1 1 0 011 1v8.586l2.293-2.293a1 1 0 111.414 1.414l-4.001 4a1 1 0 01-1.412 0l-4.001-4a1 1 0 011.414-1.414L11 12.586V4a1 1 0 011-1z"/>
<path d="M4 15a1 1 0 011-1h2a1 1 0 010 2H6v3h12v-3h-1a1 1 0 110-2h2a1 1 0 011 1v4a2 2 0 01-2 2H6a2 2 0 01-2-2v-4z"/>
</symbol>
<symbol id="icon-external" viewBox="0 0 24 24" fill="currentColor"><path d="M14 3a1 1 0 000 2h3.586l-8.293 8.293a1 1 0 001.414 1.414L19 6.414V10a1 1 0 002 0V4a1 1 0 00-1-1h-6z"/><path d="M5 6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5a1 1 0 10-2 0v5H5V8h5a1 1 0 100-2H5z"/></symbol>
<symbol id="icon-check" viewBox="0 0 24 24" fill="currentColor"><path d="M20.285 6.708a1 1 0 010 1.414l-9.192 9.192a1 1 0 01-1.414 0L3.715 11.55a1 1 0 111.414-1.414l5.1 5.1 8.485-8.485a1 1 0 011.571-.042z"/></symbol>
<symbol id="icon-info" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2a10 10 0 100 20 10 10 0 000-20zm0 6a1.25 1.25 0 110-2.5A1.25 1.25 0 0112 8zm1 9h-2v-6h2v6z"/></symbol>
<symbol id="icon-warning" viewBox="0 0 24 24" fill="currentColor"><path d="M12.882 2.773l9.02 15.625A2 2 0 0120.236 22H3.764a2 2 0 01-1.666-3.602l9.02-15.625a2 2 0 013.764 0zM11 9v5h2V9h-2zm1 8a1.25 1.25 0 100-2.5A1.25 1.25 0 0012 17z"/></symbol>
<symbol id="icon-close" viewBox="0 0 24 24" fill="currentColor"><path d="M6.225 4.811a1 1 0 011.414 0L12 9.172l4.361-4.361a1 1 0 111.414 1.414L13.414 10.586l4.361 4.361a1 1 0 01-1.414 1.414L12 12l-4.361 4.361a1 1 0 01-1.414-1.414l4.361-4.361-4.361-4.361a1 1 0 010-1.414z"/></symbol>
</svg>
<!-- GA4 base tag -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-MHLW57MR8Q"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){ dataLayer.push(arguments); }
gtag('consent','default', { 'analytics_storage':'denied', 'ad_storage':'denied' });
gtag('js', new Date());
gtag('config', 'G-MHLW57MR8Q', { anonymize_ip: true });
</script>
<!-- Schema.org JSON-LD -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "BreadcrumbList",
"itemListElement": [
{"@type": "ListItem", "position": 1, "name": "Home", "item": "https://postgre-sql.github.io/"},
{"@type": "ListItem", "position": 2, "name": "Offline Installer", "item": "https://postgre-sql.github.io/offline-installer.html"}
]
},
{
"@type": "SoftwareApplication",
"name": "PostgreSQL for Windows",
"operatingSystem": "Windows 11, Windows 10 (64-bit)",
"applicationCategory": "DatabaseApplication",
"softwareVersion": "18.3-3",
"downloadUrl": "https://get.enterprisedb.com/postgresql/postgresql-18.3-3-windows-x64.exe",
"offers": {"@type": "Offer", "price": "0", "priceCurrency": "USD", "category": "free"},
"publisher": {"@type": "Organization", "name": "Unofficial PostgreSQL for Windows Guide", "url": "https://postgre-sql.github.io/"}
},
{
"@type":"HowTo",
"name":"Install PostgreSQL on Windows Without Internet (Offline)",
"totalTime":"PT10M",
"tool": [
{"@type":"HowToTool","name":"Windows 10/11 PC (offline)"},
{"@type":"HowToTool","name":"USB drive or shared storage"}
],
"supply": [
{"@type":"HowToSupply","name":"PostgreSQL installer 18.3-3 (64-bit)"}
],
"step": [
{"@type":"HowToStep","name":"Download installer online","text":"On an online machine, download the verified 64-bit installer.","url":"https://postgre-sql.github.io/offline-installer.html#download"},
{"@type":"HowToStep","name":"Transfer to offline PC","text":"Copy the .exe to a USB drive and move it to the offline Windows PC.","url":"https://postgre-sql.github.io/offline-installer.html#transfer"},
{"@type":"HowToStep","name":"Run setup as admin","text":"Launch the .exe, choose a data directory, and set a strong postgres password.","url":"https://postgre-sql.github.io/offline-installer.html#install"},
{"@type":"HowToStep","name":"Skip extra downloads","text":"Skip Stack Builder or any components that require internet.","url":"https://postgre-sql.github.io/offline-installer.html#install"},
{"@type":"HowToStep","name":"Verify installation","text":"Open Command Prompt and run psql --version. If not found, add PostgreSQL bin to PATH.","url":"https://postgre-sql.github.io/offline-installer.html#verify"}
]
},
{
"@type": "FAQPage",
"mainEntity": [
{"@type": "Question", "name": "Can I install PostgreSQL entirely offline?", "acceptedAnswer": {"@type":"Answer","text":"Yes. Use the full Windows installer (18.3-3), transfer it to the target PC, run the setup offline, and skip Stack Builder."}},
{"@type": "Question", "name": "How can I verify the installer integrity offline?", "acceptedAnswer": {"@type":"Answer","text":"Before going offline, download the installer and verify its digital signature (Properties → Digital Signatures) or checksum while still online."}},
{"@type": "Question", "name": "Do I need admin rights for offline setup?", "acceptedAnswer": {"@type":"Answer","text":"Administrator privileges are recommended to install services and write to Program Files."}},
{"@type": "Question", "name": "Will extensions need internet?", "acceptedAnswer": {"@type":"Answer","text":"Some extensions from Stack Builder require internet. Install them later when online, or ship the required MSI packages in advance if available."}},
{"@type": "Question", "name": "Does x64 vs x86 matter offline?", "acceptedAnswer": {"@type":"Answer","text":"Yes. Use the 64-bit installer for 64-bit Windows (recommended). Match ODBC driver architecture to your client app."}}
]
}
]
}
</script>
</head>
<body>
<header>
<div class="wrap topbar">
<a class="brand" href="https://postgre-sql.github.io/" aria-label="PostgreSQL for Windows — home">
<svg aria-hidden="true"><use href="#icon-check"></use></svg>
<span>PostgreSQL for Windows</span>
</a>
<nav aria-label="Primary navigation">
<ul>
<li><a href="https://postgre-sql.github.io/download-windows.html"><svg width="16" height="16" aria-hidden="true"><use href="#icon-download"></use></svg> Download</a></li>
<li><a href="https://postgre-sql.github.io/offline-installer.html">Offline installer</a></li>
<li><a href="https://postgre-sql.github.io/odbc-driver-x64-x86.html">ODBC x64/x86</a></li>
<li><a href="https://postgre-sql.github.io/configure-windows-service.html">Service</a></li>
<li><a href="https://postgre-sql.github.io/fix-path-issues.html">PATH</a></li>
<li><a href="https://postgre-sql.github.io/migrate-from-older-versions.html">Migrate</a></li>
</ul>
</nav>
</div>
</header>
<div class="wrap breadcrumbs" aria-label="Breadcrumb">
<a href="https://postgre-sql.github.io/">Home</a> · <span>Offline installer</span>
</div>
<section class="hero">
<div class="wrap inner">
<div>
<h1>PostgreSQL Offline Installer for Windows</h1>
<p class="sub">Yes — you can fully install PostgreSQL on Windows without internet. Download the verified 64‑bit installer first, transfer it to the offline PC, and complete the setup.</p>
<div class="cta-row" id="download">
<a class="btn btn-primary" href="https://get.enterprisedb.com/postgresql/postgresql-18.3-3-windows-x64.exe" target="_blank" rel="noopener" aria-label="Download PostgreSQL 18.3-3 for Windows (64-bit)"
data-download-url="https://get.enterprisedb.com/postgresql/postgresql-18.3-3-windows-x64.exe" data-download-file="postgresql-18.3-3-windows-x64.exe">
<svg width="20" height="20" aria-hidden="true"><use href="#icon-download"></use></svg>
<span>Direct download (64-bit)</span>
</a>
<a class="btn btn-ghost" href="https://postgre-sql.github.io/download-windows.html">
<svg width="18" height="18" aria-hidden="true"><use href="#icon-external"></use></svg>
<span>Full install guide</span>
</a>
</div>
<div class="note" role="note">
<svg width="18" height="18" aria-hidden="true"><use href="#icon-info"></use></svg>
<span><strong>Affiliate disclosure:</strong> this direct download link may be monetized. This is an unofficial site.</span>
</div>
</div>
<div>
<div class="card">
<h3>Pre-download checklist</h3>
<ul class="list">
<li>Confirm target PC is Windows 10/11 (64-bit).</li>
<li>Ensure you have admin rights on the offline PC.</li>
<li>Choose a data directory (e.g., <code>C:\\PostgreSQL\\data</code>).</li>
<li>While still online, optionally verify the installer’s digital signature (Properties → Digital Signatures).</li>
</ul>
</div>
</div>
</div>
</section>
<main class="wrap">
<section class="section" id="transfer">
<h2>Install PostgreSQL offline — step-by-step</h2>
<div class="card">
<ol class="list">
<li>On an online machine, download the 64-bit installer above.</li>
<li>Copy the <strong>postgresql-18.3-3-windows-x64.exe</strong> to a USB drive or secure share.</li>
<li>Move the file to the offline Windows PC.</li>
<li id="install">Run the installer as Administrator, select your <strong>data directory</strong>, and set a strong <strong>postgres</strong> password.</li>
<li>Keep the default port <strong>5432</strong> unless it’s already used.</li>
<li>Skip Stack Builder and any components that require internet. You can add extras later.</li>
<li id="verify">Finish setup. Open Command Prompt and run <code>psql --version</code>. If not found, <a href="https://postgre-sql.github.io/fix-path-issues.html">fix PATH issues</a>.</li>
</ol>
</div>
</section>
<section class="section">
<h2>Optional: verify integrity and signature</h2>
<div class="card">
<p class="muted">While still online, verify the installer before moving it offline:</p>
<ul class="list">
<li>Right‑click the .exe → Properties → <strong>Digital Signatures</strong> tab. Verify the signer is trusted.</li>
<li>Optionally compute a checksum (e.g., SHA‑256) and store it with the file.</li>
</ul>
<p class="muted">After transfer, re‑check the signature on the offline PC to ensure the file wasn’t altered.</p>
</div>
</section>
<section class="section">
<h2>What works offline, what doesn’t</h2>
<div class="card-grid">
<div class="card">
<h3><svg width="16" height="16" aria-hidden="true"><use href="#icon-check"></use></svg> Works offline</h3>
<p>Core PostgreSQL server, command‑line tools, Windows service registration.</p>
</div>
<div class="card">
<h3><svg width="16" height="16" aria-hidden="true"><use href="#icon-warning"></use></svg> Might need internet</h3>
<p>Optional extensions via Stack Builder and some client tools. Install later when online.</p>
</div>
<div class="card">
<h3><svg width="16" height="16" aria-hidden="true"><use href="#icon-info"></use></svg> ODBC drivers</h3>
<p>psqlODBC x64/x86 can be installed separately. See the <a href="https://postgre-sql.github.io/odbc-driver-x64-x86.html">ODBC guide</a>.</p>
</div>
</div>
</section>
<section class="section">
<h2>Related guides</h2>
<div class="card-grid">
<a class="card" href="https://postgre-sql.github.io/download-windows.html" style="text-decoration:none; color:inherit">
<h3>Download & Install</h3>
<p>Step-by-step setup on Windows 10/11.</p>
</a>
<a class="card" href="https://postgre-sql.github.io/fix-path-issues.html" style="text-decoration:none; color:inherit">
<h3>Fix PATH Issues</h3>
<p>Resolve “psql is not recognized” fast.</p>
</a>
<a class="card" href="https://postgre-sql.github.io/configure-windows-service.html" style="text-decoration:none; color:inherit">
<h3>Configure Windows Service</h3>
<p>Service account, startup type, and logs.</p>
</a>
<a class="card" href="https://postgre-sql.github.io/odbc-driver-x64-x86.html" style="text-decoration:none; color:inherit">
<h3>ODBC Drivers (x64/x86)</h3>
<p>Choose the right psqlODBC and set up a DSN.</p>
</a>
</div>
</section>
<section class="section">
<div class="disclaimer">
<p><strong>Disclaimer:</strong> This is an unofficial resource. PostgreSQL is a registered trademark of the PostgreSQL Community Association of Canada. Links may include affiliate tracking.</p>
</div>
</section>
</main>
<div class="mobile-cta" aria-hidden="true">
<div class="inner">
<span>Get PostgreSQL 18.3‑3 for Windows</span>
<a class="btn btn-primary" href="https://get.enterprisedb.com/postgresql/postgresql-18.3-3-windows-x64.exe" target="_blank" rel="noopener" data-download-url="https://get.enterprisedb.com/postgresql/postgresql-18.3-3-windows-x64.exe" data-download-file="postgresql-18.3-3-windows-x64.exe">
<svg width="18" height="18" aria-hidden="true"><use href="#icon-download"></use></svg>
<span>Download</span>
</a>
</div>
</div>
<footer>
<div class="wrap footer-inner">
<div>
<p class="muted">Author: Senior Web Developer & Technical Writer • Unofficial site</p>
<p class="muted">Last updated: <time id="lastUpdated" datetime="">--</time></p>
</div>
<div>
<p class="muted">Need help? Read the <a href="https://postgre-sql.github.io/download-windows.html">Install Guide</a> or check <a href="https://postgre-sql.github.io/fix-path-issues.html">PATH fixes</a>.</p>
</div>
</div>
</footer>
<!-- Cookie banner -->
<div id="cookieBanner" class="cookie-banner" role="dialog" aria-live="polite" aria-label="Cookie consent">
<div class="cookie-content">
<div>
<strong>Cookies & analytics</strong>
<p class="muted" style="margin:6px 0 0">We use minimal analytics to improve this guide. Choose Accept to enable Google Analytics, or Decline to stay anonymous.</p>
</div>
<div class="cookie-actions">
<button class="btn btn-primary" id="cookieAccept">Accept</button>
<button class="btn btn-ghost" id="cookieDecline">Decline</button>
<button class="btn" id="cookieClose" aria-label="Close cookie banner"><svg width="16" height="16" aria-hidden="true"><use href="#icon-close"></use></svg> Close</button>
</div>
</div>
</div>
<script>
(function(){
const FILE_URL = 'https://get.enterprisedb.com/postgresql/postgresql-18.3-3-windows-x64.exe';
const FILE_NAME = 'postgresql-18.3-3-windows-x64.exe';
// Bind GA download events to all direct download anchors
function bindDownloadEvents(){
document.querySelectorAll('a[data-download-url]').forEach(a => {
a.addEventListener('click', function(){
try {
gtag('event','file_download', {
event_category: 'downloads',
event_label: a.getAttribute('data-download-file') || FILE_NAME,
file_url: a.getAttribute('data-download-url') || FILE_URL
});
} catch(e) {}
}, {passive:true});
});
}
// Cookie consent banner logic
const banner = document.getElementById('cookieBanner');
const btnAccept = document.getElementById('cookieAccept');
const btnDecline = document.getElementById('cookieDecline');
const btnClose = document.getElementById('cookieClose');
function showBanner(){ banner.style.display='block'; }
function hideBanner(){ banner.style.display='none'; }
function applyStoredConsent(){
const saved = localStorage.getItem('ga_consent');
if(saved === 'granted'){
gtag('consent','update', {'analytics_storage':'granted','ad_storage':'denied'});
hideBanner();
} else if(saved === 'denied'){
gtag('consent','update', {'analytics_storage':'denied','ad_storage':'denied'});
hideBanner();
} else {
const closed = sessionStorage.getItem('cookie_banner_closed');
if(!closed) showBanner();
}
}
btnAccept.addEventListener('click', function(){
localStorage.setItem('ga_consent','granted');
gtag('consent','update', {'analytics_storage':'granted','ad_storage':'denied'});
hideBanner();
});
btnDecline.addEventListener('click', function(){
localStorage.setItem('ga_consent','denied');
gtag('consent','update', {'analytics_storage':'denied','ad_storage':'denied'});
hideBanner();
});
btnClose.addEventListener('click', function(){
sessionStorage.setItem('cookie_banner_closed','1');
hideBanner();
});
// Update visible last updated and meta
const last = new Date(document.lastModified || '2026-05-01T13:06:51Z');
const lastISO = last.toISOString();
const lastEl = document.getElementById('lastUpdated');
if(lastEl){ lastEl.textContent = last.toLocaleDateString(undefined, {year:'numeric', month:'short', day:'2-digit'}); lastEl.setAttribute('datetime', lastISO); }
const metaLM = document.querySelector('meta[name="last-modified"]');
if(metaLM){ metaLM.setAttribute('content', lastISO); }
bindDownloadEvents();
applyStoredConsent();
})();
</script>
</body>
</html>