DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 1 | [Setup] |
| 2 | #ifdef WIN64 |
| 3 | ArchitecturesInstallIn64BitMode=x64 |
| 4 | AppName=TigerVNC 64-bit |
| 5 | AppVerName=TigerVNC 64-bit @VERSION@ (@BUILD@) |
| 6 | #else |
| 7 | AppName=TigerVNC |
| 8 | AppVerName=TigerVNC v@VERSION@ (@BUILD@) |
| 9 | #endif |
| 10 | AppVersion=@VERSION@ |
| 11 | AppPublisher=TigerVNC project |
| 12 | AppPublisherURL=http://tigervnc.org |
| 13 | DefaultDirName={pf}\TigerVNC |
| 14 | #ifdef WIN64 |
| 15 | DefaultGroupName=TigerVNC 64-bit |
| 16 | #else |
| 17 | DefaultGroupName=TigerVNC |
| 18 | #endif |
| 19 | LicenseFile=@CMAKE_SOURCE_DIR@\LICENCE.txt |
| 20 | |
Brian P. Hinz | 6a7f908 | 2017-08-21 18:10:32 -0400 | [diff] [blame] | 21 | [Dirs] |
| 22 | ; This directory is necessary to prevent the X509 file chooser from causing |
| 23 | ; an error dialog to appear when GetOpenFileName is called by SYSTEM account. |
| 24 | Name: "{sys}\config\systemprofile\Desktop" |
| 25 | |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 26 | [Files] |
| 27 | #ifdef BUILD_WINVNC |
DRC | c67db65 | 2011-11-08 08:51:04 +0000 | [diff] [blame] | 28 | Source: "@CMAKE_CURRENT_BINARY_DIR@\win\winvnc\winvnc4.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace; |
Brian Hinz | e899131 | 2013-04-27 20:20:57 +0000 | [diff] [blame] | 29 | Source: "@CMAKE_CURRENT_BINARY_DIR@\win\wm_hooks\wm_hooks.dll"; DestDir: "{app}"; Flags: ignoreversion restartreplace; |
DRC | c67db65 | 2011-11-08 08:51:04 +0000 | [diff] [blame] | 30 | Source: "@CMAKE_CURRENT_BINARY_DIR@\win\vncconfig\vncconfig.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace; |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 31 | #endif |
DRC | c67db65 | 2011-11-08 08:51:04 +0000 | [diff] [blame] | 32 | Source: "@CMAKE_CURRENT_BINARY_DIR@\vncviewer\vncviewer.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace; |
Peter Åstrand (astrand) | 6011f96 | 2017-11-29 09:11:29 +0100 | [diff] [blame^] | 33 | Source: "@CMAKE_SOURCE_DIR@\README.rst"; DestDir: "{app}"; Flags: ignoreversion |
DRC | e72b805 | 2011-06-28 03:02:38 +0000 | [diff] [blame] | 34 | Source: "@CMAKE_SOURCE_DIR@\LICENCE.TXT"; DestDir: "{app}"; Flags: ignoreversion |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 35 | |
| 36 | |
| 37 | [Icons] |
| 38 | Name: "{group}\TigerVNC Viewer"; FileName: "{app}\vncviewer.exe"; |
| 39 | Name: "{group}\Listening TigerVNC Viewer"; FileName: "{app}\vncviewer.exe"; Parameters: "-listen"; |
| 40 | |
| 41 | #ifdef BUILD_WINVNC |
| 42 | Name: "{group}\VNC Server (User-Mode)\Run VNC Server"; FileName: "{app}\winvnc4.exe"; Parameters: "-noconsole"; |
| 43 | Name: "{group}\VNC Server (User-Mode)\Configure VNC Server"; FileName: "{app}\vncconfig.exe"; Parameters: "-user"; |
| 44 | |
| 45 | Name: "{group}\VNC Server (Service-Mode)\Configure VNC Service"; FileName: "{app}\vncconfig.exe"; Parameters: "-noconsole -service"; |
| 46 | Name: "{group}\VNC Server (Service-Mode)\Register VNC Service"; FileName: "{app}\winvnc4.exe"; Parameters: "-register"; |
| 47 | Name: "{group}\VNC Server (Service-Mode)\Unregister VNC Service"; FileName: "{app}\winvnc4.exe"; Parameters: "-unregister"; |
| 48 | Name: "{group}\VNC Server (Service-Mode)\Start VNC Service"; FileName: "{app}\winvnc4.exe"; Parameters: "-noconsole -start"; |
| 49 | Name: "{group}\VNC Server (Service-Mode)\Stop VNC Service"; FileName: "{app}\winvnc4.exe"; Parameters: "-noconsole -stop"; |
| 50 | #endif |
DRC | e72b805 | 2011-06-28 03:02:38 +0000 | [diff] [blame] | 51 | Name: "{group}\License"; FileName: "write.exe"; Parameters: "LICENCE.TXT"; WorkingDir: "{app}"; Flags: "useapppaths" |
Peter Åstrand (astrand) | 6011f96 | 2017-11-29 09:11:29 +0100 | [diff] [blame^] | 52 | Name: "{group}\Read Me"; FileName: "write.exe"; Parameters: "README.rst"; WorkingDir: "{app}"; Flags: "useapppaths" |
DRC | 180c016 | 2010-10-27 07:20:27 +0000 | [diff] [blame] | 53 | Name: "{group}\Uninstall TigerVNC"; FileName: "{uninstallexe}"; WorkingDir: "{app}"; |
| 54 | |
| 55 | #ifdef BUILD_WINVNC |
| 56 | [Tasks] |
| 57 | Name: installservice; Description: "&Register new TigerVNC Server as a system service"; GroupDescription: "Server configuration:"; |
| 58 | Name: startservice; Description: "&Start or restart TigerVNC service"; GroupDescription: "Server configuration:"; |
| 59 | |
| 60 | [Run] |
| 61 | Filename: "{app}\winvnc4.exe"; Parameters: "-register"; Tasks: installservice |
| 62 | Filename: "net"; Parameters: "start winvnc4"; Tasks: startservice |
| 63 | #endif |
Samuel Mannehed | 60c4193 | 2014-02-07 14:53:24 +0000 | [diff] [blame] | 64 | |
| 65 | #ifdef BUILD_WINVNC |
| 66 | [Code] |
| 67 | |
| 68 | {--- IShellLink ---} |
| 69 | |
| 70 | const |
| 71 | CLSID_ShellLink = '{00021401-0000-0000-C000-000000000046}'; |
| 72 | SLDF_RUNAS_USER = $2000; |
| 73 | |
| 74 | type |
| 75 | IShellLinkW = interface(IUnknown) |
| 76 | '{000214F9-0000-0000-C000-000000000046}' |
| 77 | procedure Dummy; |
| 78 | procedure Dummy2; |
| 79 | procedure Dummy3; |
| 80 | function GetDescription(pszName: String; cchMaxName: Integer): HResult; |
| 81 | function SetDescription(pszName: String): HResult; |
| 82 | function GetWorkingDirectory(pszDir: String; cchMaxPath: Integer): HResult; |
| 83 | function SetWorkingDirectory(pszDir: String): HResult; |
| 84 | function GetArguments(pszArgs: String; cchMaxPath: Integer): HResult; |
| 85 | function SetArguments(pszArgs: String): HResult; |
| 86 | function GetHotkey(var pwHotkey: Word): HResult; |
| 87 | function SetHotkey(wHotkey: Word): HResult; |
| 88 | function GetShowCmd(out piShowCmd: Integer): HResult; |
| 89 | function SetShowCmd(iShowCmd: Integer): HResult; |
| 90 | function GetIconLocation(pszIconPath: String; cchIconPath: Integer; |
| 91 | out piIcon: Integer): HResult; |
| 92 | function SetIconLocation(pszIconPath: String; iIcon: Integer): HResult; |
| 93 | function SetRelativePath(pszPathRel: String; dwReserved: DWORD): HResult; |
| 94 | function Resolve(Wnd: HWND; fFlags: DWORD): HResult; |
| 95 | function SetPath(pszFile: String): HResult; |
| 96 | end; |
| 97 | |
| 98 | IShellLinkDataList = interface(IUnknown) |
| 99 | '{45E2B4AE-B1C3-11D0-B92F-00A0C90312E1}' |
| 100 | function AddDataBlock(pDataBlock : DWORD) : HResult; |
| 101 | function CopyDataBlock(dwSig : DWORD; var ppDataBlock : DWORD) : HResult; |
| 102 | function RemoveDataBlock(dwSig : DWORD) : HResult; |
| 103 | function GetFlags(var pdwFlags : DWORD) : HResult; |
| 104 | function SetFlags(dwFlags : DWORD) : HResult; |
| 105 | end; |
| 106 | |
| 107 | IPersist = interface(IUnknown) |
| 108 | '{0000010C-0000-0000-C000-000000000046}' |
| 109 | function GetClassID(var classID: TGUID): HResult; |
| 110 | end; |
| 111 | |
| 112 | IPersistFile = interface(IPersist) |
| 113 | '{0000010B-0000-0000-C000-000000000046}' |
| 114 | function IsDirty: HResult; |
| 115 | function Load(pszFileName: String; dwMode: Longint): HResult; |
| 116 | function Save(pszFileName: String; fRemember: BOOL): HResult; |
| 117 | function SaveCompleted(pszFileName: String): HResult; |
| 118 | function GetCurFile(out pszFileName: String): HResult; |
| 119 | end; |
| 120 | |
| 121 | var |
| 122 | OSVersion: TWindowsVersion; |
| 123 | |
| 124 | function InitializeSetup: Boolean; |
| 125 | begin |
| 126 | GetWindowsVersionEx(OSVersion); |
| 127 | Result := True; |
| 128 | end; |
| 129 | |
| 130 | procedure SetRunAsUserFlag(Path: String); |
| 131 | var |
| 132 | Obj: IUnknown; |
| 133 | SL: IShellLinkW; |
| 134 | SDL: IShellLinkDataList; |
| 135 | PF: IPersistFile; |
| 136 | Flags: DWord; |
| 137 | begin |
| 138 | Obj := CreateComObject(StringToGuid(CLSID_ShellLink)); |
| 139 | SL := IShellLinkW(Obj); |
| 140 | PF := IPersistFile(Obj); |
| 141 | SDL := IShellLinkDataList(Obj); |
| 142 | Path := ExpandConstant(Path); |
| 143 | OleCheck(PF.Load(Path, 0)); |
| 144 | OleCheck(SDL.GetFlags(Flags)); |
| 145 | OleCheck(SDL.SetFlags(Flags or SLDF_RUNAS_USER)); |
| 146 | OleCheck(PF.Save(Path, True)); |
| 147 | end; |
| 148 | |
| 149 | procedure CurStepChanged(CurStep: TSetupStep); |
| 150 | var |
| 151 | Flags: DWord; |
| 152 | begin |
| 153 | { Post-install actions on Windows Vista and higher: |
| 154 | o Modify Service-Mode start menu commands so they run as administrator. |
| 155 | o Set up the SoftwareSASGeneration system policy so as to allow services to simulate Ctrl+Alt+Del. } |
| 156 | if (CurStep = ssPostInstall) and (OSVersion.Major >= 6) then begin |
| 157 | SetRunAsUserFlag('{group}\VNC Server (Service-Mode)\Configure VNC Service.lnk'); |
| 158 | SetRunAsUserFlag('{group}\VNC Server (Service-Mode)\Register VNC Service.lnk'); |
| 159 | SetRunAsUserFlag('{group}\VNC Server (Service-Mode)\Unregister VNC Service.lnk'); |
| 160 | SetRunAsUserFlag('{group}\VNC Server (Service-Mode)\Start VNC Service.lnk'); |
| 161 | SetRunAsUserFlag('{group}\VNC Server (Service-Mode)\Stop VNC Service.lnk'); |
| 162 | if not RegQueryDWordValue( |
| 163 | HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System', |
| 164 | 'SoftwareSASGeneration', Flags |
| 165 | ) then Flags := 0; |
| 166 | RegWriteDWordValue( |
| 167 | HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System', |
| 168 | 'SoftwareSASGeneration', Flags or 1 |
| 169 | ); |
| 170 | end; |
| 171 | end; |
| 172 | #endif |