File size: 1,843 Bytes
ff9dc92
 
5916f2b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!doctype html>
<html>
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <title>NO-ADMIN Utility</title>
  <link rel="stylesheet" href="style.css" />
</head>
<body>
  <div class="card">
    <h1>NO-ADMIN Utility</h1>
    <p>Select your installer or executable file below. We’ll generate a .bat script that runs the installer without requiring admin privileges.</p>
    <input type="file" id="fileInput" accept=".exe,.msi,.bat,.cmd" />
    <button id="generateButton">Generate Script</button>
    <a id="downloadLink" style="display:none; margin-top:1rem;">Download your NO-ADMIN BAT file</a>
    <p style="margin-top:1rem;">Instructions: place this batch file in the same folder as your installer and double-click it to run. This uses the RunAsInvoker compatibility layer to bypass admin prompts.</p>
  </div>
  <script>
    const fileInput = document.getElementById('fileInput');
    const generateButton = document.getElementById('generateButton');
    const downloadLink = document.getElementById('downloadLink');
    generateButton.addEventListener('click', () => {
      const file = fileInput.files[0];
      if (!file) {
        alert('Please select a file to wrap.');
        return;
      }
      const fileName = file.name;
      const scriptContent = '@echo off\r\n' +
        'set __COMPAT_LAYER=RunAsInvoker\r\n' +
        'start "' + fileName + '"\r\n';
      const blob = new Blob([scriptContent], { type: 'text/plain' });
      downloadLink.href = URL.createObjectURL(blob);
      const baseName = fileName.substring(0, fileName.lastIndexOf('.')) || fileName;
      downloadLink.download = baseName + '-no-admin.bat';
      downloadLink.style.display = 'block';
      downloadLink.textContent = 'Download ' + downloadLink.download;
    });
  </script>
</body>
</html>