├── .editorconfig ├── .gitattributes ├── .gitignore ├── CREDITS.txt ├── ComposerAdmin ├── ComposerAdmin.csproj ├── Forms │ ├── ACLEditorControl.Designer.cs │ ├── ACLEditorControl.cs │ ├── ACLEditorControl.resx │ ├── FormAbout.Designer.cs │ ├── FormAbout.cs │ ├── FormAbout.resx │ ├── FormComposerEditor.Designer.cs │ ├── FormComposerEditor.cs │ ├── FormComposerEditor.resx │ ├── FormInputNetworkPath.Designer.cs │ ├── FormInputNetworkPath.cs │ ├── FormInputNetworkPath.resx │ ├── FormSettings.Designer.cs │ ├── FormSettings.cs │ ├── FormSettings.resx │ ├── FormShortcutProperties.Designer.cs │ ├── FormShortcutProperties.cs │ ├── FormShortcutProperties.resx │ ├── StartMenuEditorControl.Designer.cs │ ├── StartMenuEditorControl.cs │ └── StartMenuEditorControl.resx ├── IconPickerDialog.cs ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── Resources │ ├── AppIcon.ico │ ├── ApplicationLogo.png │ ├── app_icon.ico │ ├── app_icon_256.png │ ├── computer_go.png │ ├── computer_link.png │ ├── disk.png │ ├── drive_disk.png │ ├── folder_link.png │ ├── folder_page.png │ └── new.png ├── Tools │ └── ADMX │ │ ├── SequenceDesktopComposer.admx │ │ ├── SequenceSoftware.admx │ │ └── en-US │ │ ├── SequenceDesktopComposer.adml │ │ └── SequenceSoftware.adml ├── app.config └── packages.config ├── ComposerAgent ├── AgentInstaller.cs ├── AppLogger.cs ├── Composer.cs ├── ComposerAgent.csproj ├── ComposerMap.cs ├── ConsoleHandler.cs ├── Constants.cs ├── InputArguments.cs ├── Program.cs ├── Properties │ └── AssemblyInfo.cs ├── UtilityArguments.cs ├── app.config └── packages.config ├── DesktopComposer.sln ├── DesktopComposer ├── AppLogger.cs ├── DesktopComposer.csproj ├── DirectoryIterator.cs ├── FileUtils.cs ├── Implementation │ ├── ACL.cs │ ├── ACLs.cs │ ├── Composition.cs │ ├── Shortcut.cs │ └── Shortcuts.cs ├── Interfaces │ ├── IACL.cs │ └── IShortcut.cs ├── MsiShortcutParser.cs ├── Properties │ └── AssemblyInfo.cs ├── ShellIcon.cs └── packages.config ├── LICENSE ├── README.md ├── Setup ├── Setup-ComposerAdmin.iss └── Setup-ComposerAgent.iss └── images └── screenshot.png /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | 3 | # CA1707: Rimuovere i caratteri di sottolineatura dal nome di membro DesktopComposer.ShellIcon.MAX_PATH. 4 | dotnet_diagnostic.CA1707.severity = silent 5 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Build results 17 | [Dd]ebug/ 18 | [Dd]ebugPublic/ 19 | [Rr]elease/ 20 | [Rr]eleases/ 21 | x64/ 22 | x86/ 23 | [Aa][Rr][Mm]/ 24 | [Aa][Rr][Mm]64/ 25 | bld/ 26 | [Bb]in/ 27 | [Oo]bj/ 28 | [Ll]og/ 29 | 30 | # Visual Studio 2015/2017 cache/options directory 31 | .vs/ 32 | # Uncomment if you have tasks that create the project's static files in wwwroot 33 | #wwwroot/ 34 | 35 | # Visual Studio 2017 auto generated files 36 | Generated\ Files/ 37 | 38 | # MSTest test Results 39 | [Tt]est[Rr]esult*/ 40 | [Bb]uild[Ll]og.* 41 | 42 | # NUNIT 43 | *.VisualState.xml 44 | TestResult.xml 45 | 46 | # Build Results of an ATL Project 47 | [Dd]ebugPS/ 48 | [Rr]eleasePS/ 49 | dlldata.c 50 | 51 | # Benchmark Results 52 | BenchmarkDotNet.Artifacts/ 53 | 54 | # .NET Core 55 | project.lock.json 56 | project.fragment.lock.json 57 | artifacts/ 58 | 59 | # StyleCop 60 | StyleCopReport.xml 61 | 62 | # Files built by Visual Studio 63 | *_i.c 64 | *_p.c 65 | *_h.h 66 | *.ilk 67 | *.meta 68 | *.obj 69 | *.iobj 70 | *.pch 71 | *.pdb 72 | *.ipdb 73 | *.pgc 74 | *.pgd 75 | *.rsp 76 | *.sbr 77 | *.tlb 78 | *.tli 79 | *.tlh 80 | *.tmp 81 | *.tmp_proj 82 | *_wpftmp.csproj 83 | *.log 84 | *.vspscc 85 | *.vssscc 86 | .builds 87 | *.pidb 88 | *.svclog 89 | *.scc 90 | 91 | # Chutzpah Test files 92 | _Chutzpah* 93 | 94 | # Visual C++ cache files 95 | ipch/ 96 | *.aps 97 | *.ncb 98 | *.opendb 99 | *.opensdf 100 | *.sdf 101 | *.cachefile 102 | *.VC.db 103 | *.VC.VC.opendb 104 | 105 | # Visual Studio profiler 106 | *.psess 107 | *.vsp 108 | *.vspx 109 | *.sap 110 | 111 | # Visual Studio Trace Files 112 | *.e2e 113 | 114 | # TFS 2012 Local Workspace 115 | $tf/ 116 | 117 | # Guidance Automation Toolkit 118 | *.gpState 119 | 120 | # ReSharper is a .NET coding add-in 121 | _ReSharper*/ 122 | *.[Rr]e[Ss]harper 123 | *.DotSettings.user 124 | 125 | # JustCode is a .NET coding add-in 126 | .JustCode 127 | 128 | # TeamCity is a build add-in 129 | _TeamCity* 130 | 131 | # DotCover is a Code Coverage Tool 132 | *.dotCover 133 | 134 | # AxoCover is a Code Coverage Tool 135 | .axoCover/* 136 | !.axoCover/settings.json 137 | 138 | # Visual Studio code coverage results 139 | *.coverage 140 | *.coveragexml 141 | 142 | # NCrunch 143 | _NCrunch_* 144 | .*crunch*.local.xml 145 | nCrunchTemp_* 146 | 147 | # MightyMoose 148 | *.mm.* 149 | AutoTest.Net/ 150 | 151 | # Web workbench (sass) 152 | .sass-cache/ 153 | 154 | # Installshield output folder 155 | [Ee]xpress/ 156 | 157 | # DocProject is a documentation generator add-in 158 | DocProject/buildhelp/ 159 | DocProject/Help/*.HxT 160 | DocProject/Help/*.HxC 161 | DocProject/Help/*.hhc 162 | DocProject/Help/*.hhk 163 | DocProject/Help/*.hhp 164 | DocProject/Help/Html2 165 | DocProject/Help/html 166 | 167 | # Click-Once directory 168 | publish/ 169 | 170 | # Publish Web Output 171 | *.[Pp]ublish.xml 172 | *.azurePubxml 173 | # Note: Comment the next line if you want to checkin your web deploy settings, 174 | # but database connection strings (with potential passwords) will be unencrypted 175 | *.pubxml 176 | *.publishproj 177 | 178 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 179 | # checkin your Azure Web App publish settings, but sensitive information contained 180 | # in these scripts will be unencrypted 181 | PublishScripts/ 182 | 183 | # NuGet Packages 184 | *.nupkg 185 | # The packages folder can be ignored because of Package Restore 186 | **/[Pp]ackages/* 187 | # except build/, which is used as an MSBuild target. 188 | !**/[Pp]ackages/build/ 189 | # Uncomment if necessary however generally it will be regenerated when needed 190 | #!**/[Pp]ackages/repositories.config 191 | # NuGet v3's project.json files produces more ignorable files 192 | *.nuget.props 193 | *.nuget.targets 194 | 195 | # Microsoft Azure Build Output 196 | csx/ 197 | *.build.csdef 198 | 199 | # Microsoft Azure Emulator 200 | ecf/ 201 | rcf/ 202 | 203 | # Windows Store app package directories and files 204 | AppPackages/ 205 | BundleArtifacts/ 206 | Package.StoreAssociation.xml 207 | _pkginfo.txt 208 | *.appx 209 | 210 | # Visual Studio cache files 211 | # files ending in .cache can be ignored 212 | *.[Cc]ache 213 | # but keep track of directories ending in .cache 214 | !?*.[Cc]ache/ 215 | 216 | # Others 217 | ClientBin/ 218 | ~$* 219 | *~ 220 | *.dbmdl 221 | *.dbproj.schemaview 222 | *.jfm 223 | *.pfx 224 | *.publishsettings 225 | orleans.codegen.cs 226 | 227 | # Including strong name files can present a security risk 228 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 229 | #*.snk 230 | 231 | # Since there are multiple workflows, uncomment next line to ignore bower_components 232 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 233 | #bower_components/ 234 | 235 | # RIA/Silverlight projects 236 | Generated_Code/ 237 | 238 | # Backup & report files from converting an old project file 239 | # to a newer Visual Studio version. Backup files are not needed, 240 | # because we have git ;-) 241 | _UpgradeReport_Files/ 242 | Backup*/ 243 | UpgradeLog*.XML 244 | UpgradeLog*.htm 245 | ServiceFabricBackup/ 246 | *.rptproj.bak 247 | 248 | # SQL Server files 249 | *.mdf 250 | *.ldf 251 | *.ndf 252 | 253 | # Business Intelligence projects 254 | *.rdl.data 255 | *.bim.layout 256 | *.bim_*.settings 257 | *.rptproj.rsuser 258 | *- Backup*.rdl 259 | 260 | # Microsoft Fakes 261 | FakesAssemblies/ 262 | 263 | # GhostDoc plugin setting file 264 | *.GhostDoc.xml 265 | 266 | # Node.js Tools for Visual Studio 267 | .ntvs_analysis.dat 268 | node_modules/ 269 | 270 | # Visual Studio 6 build log 271 | *.plg 272 | 273 | # Visual Studio 6 workspace options file 274 | *.opt 275 | 276 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 277 | *.vbw 278 | 279 | # Visual Studio LightSwitch build output 280 | **/*.HTMLClient/GeneratedArtifacts 281 | **/*.DesktopClient/GeneratedArtifacts 282 | **/*.DesktopClient/ModelManifest.xml 283 | **/*.Server/GeneratedArtifacts 284 | **/*.Server/ModelManifest.xml 285 | _Pvt_Extensions 286 | 287 | # Paket dependency manager 288 | .paket/paket.exe 289 | paket-files/ 290 | 291 | # FAKE - F# Make 292 | .fake/ 293 | 294 | # JetBrains Rider 295 | .idea/ 296 | *.sln.iml 297 | 298 | # CodeRush personal settings 299 | .cr/personal 300 | 301 | # Python Tools for Visual Studio (PTVS) 302 | __pycache__/ 303 | *.pyc 304 | 305 | # Cake - Uncomment if you are using it 306 | # tools/** 307 | # !tools/packages.config 308 | 309 | # Tabs Studio 310 | *.tss 311 | 312 | # Telerik's JustMock configuration file 313 | *.jmconfig 314 | 315 | # BizTalk build output 316 | *.btp.cs 317 | *.btm.cs 318 | *.odx.cs 319 | *.xsd.cs 320 | 321 | # OpenCover UI analysis results 322 | OpenCover/ 323 | 324 | # Azure Stream Analytics local run output 325 | ASALocalRun/ 326 | 327 | # MSBuild Binary and Structured Log 328 | *.binlog 329 | 330 | # NVidia Nsight GPU debugger configuration file 331 | *.nvuser 332 | 333 | # MFractors (Xamarin productivity tool) working folder 334 | .mfractor/ 335 | 336 | # Local History for Visual Studio 337 | .localhistory/ 338 | 339 | # BeatPulse healthcheck temp database 340 | healthchecksdb 341 | 342 | #InnoSetup 343 | Setup/Output/* 344 | -------------------------------------------------------------------------------- /CREDITS.txt: -------------------------------------------------------------------------------- 1 | Icons: FatCow Free Icons - https://www.fatcow.com/free-icons 2 | 3 | -------------------------------------------------------------------------------- /ComposerAdmin/Forms/ACLEditorControl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace ComposerAdmin.Forms 2 | { 3 | partial class ACLEditorControl 4 | { 5 | /// 6 | /// Variabile di progettazione necessaria. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Pulire le risorse in uso. 12 | /// 13 | /// ha valore true se le risorse gestite devono essere eliminate, false in caso contrario. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Codice generato da Progettazione componenti 24 | 25 | /// 26 | /// Metodo necessario per il supporto della finestra di progettazione. Non modificare 27 | /// il contenuto del metodo con l'editor di codice. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ACLEditorControl)); 33 | this.lv = new System.Windows.Forms.ListView(); 34 | this.imlIcons = new System.Windows.Forms.ImageList(this.components); 35 | this.ADPicker = new Tulpep.ActiveDirectoryObjectPicker.DirectoryObjectPickerDialog(); 36 | this.ctxMenu = new System.Windows.Forms.ContextMenuStrip(this.components); 37 | this.ctxMenuDeny = new System.Windows.Forms.ToolStripMenuItem(); 38 | this.ctxMenuDisabled = new System.Windows.Forms.ToolStripMenuItem(); 39 | this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 40 | this.ctxMenu.SuspendLayout(); 41 | this.SuspendLayout(); 42 | // 43 | // lv 44 | // 45 | this.lv.ContextMenuStrip = this.ctxMenu; 46 | resources.ApplyResources(this.lv, "lv"); 47 | this.lv.HideSelection = false; 48 | this.lv.LargeImageList = this.imlIcons; 49 | this.lv.Name = "lv"; 50 | this.lv.SmallImageList = this.imlIcons; 51 | this.lv.UseCompatibleStateImageBehavior = false; 52 | this.lv.View = System.Windows.Forms.View.List; 53 | this.lv.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.lv_ItemSelectionChanged); 54 | // 55 | // imlIcons 56 | // 57 | this.imlIcons.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imlIcons.ImageStream"))); 58 | this.imlIcons.TransparentColor = System.Drawing.Color.Transparent; 59 | this.imlIcons.Images.SetKeyName(0, "dsuiext_4099.ico"); 60 | this.imlIcons.Images.SetKeyName(1, "dsuiext_4108.ico"); 61 | this.imlIcons.Images.SetKeyName(2, "userdeny_4099.ico"); 62 | this.imlIcons.Images.SetKeyName(3, "groupdeny.ico"); 63 | this.imlIcons.Images.SetKeyName(4, "userdisabled.ico"); 64 | this.imlIcons.Images.SetKeyName(5, "groupdisabled.ico"); 65 | // 66 | // ADPicker 67 | // 68 | this.ADPicker.AttributesToFetch.Add("objectSid"); 69 | this.ADPicker.AttributesToFetch.Add("sAMAccountName"); 70 | // 71 | // ctxMenu 72 | // 73 | this.ctxMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 74 | this.ctxMenuDeny, 75 | this.ctxMenuDisabled, 76 | this.deleteToolStripMenuItem}); 77 | this.ctxMenu.Name = "ctxMenu"; 78 | resources.ApplyResources(this.ctxMenu, "ctxMenu"); 79 | this.ctxMenu.Opening += new System.ComponentModel.CancelEventHandler(this.ctxMenu_Open); 80 | // 81 | // ctxMenuDeny 82 | // 83 | this.ctxMenuDeny.CheckOnClick = true; 84 | this.ctxMenuDeny.Name = "ctxMenuDeny"; 85 | resources.ApplyResources(this.ctxMenuDeny, "ctxMenuDeny"); 86 | this.ctxMenuDeny.CheckedChanged += new System.EventHandler(this.CtxMenu_CheckChanged); 87 | // 88 | // ctxMenuDisabled 89 | // 90 | this.ctxMenuDisabled.CheckOnClick = true; 91 | this.ctxMenuDisabled.Name = "ctxMenuDisabled"; 92 | resources.ApplyResources(this.ctxMenuDisabled, "ctxMenuDisabled"); 93 | this.ctxMenuDisabled.CheckedChanged += new System.EventHandler(this.CtxMenu_CheckChanged); 94 | // 95 | // deleteToolStripMenuItem 96 | // 97 | this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem"; 98 | resources.ApplyResources(this.deleteToolStripMenuItem, "deleteToolStripMenuItem"); 99 | // 100 | // ACLEditorControl 101 | // 102 | resources.ApplyResources(this, "$this"); 103 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 104 | this.Controls.Add(this.lv); 105 | this.Name = "ACLEditorControl"; 106 | this.ctxMenu.ResumeLayout(false); 107 | this.ResumeLayout(false); 108 | 109 | } 110 | 111 | #endregion 112 | 113 | private System.Windows.Forms.ListView lv; 114 | private System.Windows.Forms.ImageList imlIcons; 115 | private Tulpep.ActiveDirectoryObjectPicker.DirectoryObjectPickerDialog ADPicker; 116 | private System.Windows.Forms.ContextMenuStrip ctxMenu; 117 | private System.Windows.Forms.ToolStripMenuItem ctxMenuDeny; 118 | private System.Windows.Forms.ToolStripMenuItem ctxMenuDisabled; 119 | private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem; 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /ComposerAdmin/Forms/ACLEditorControl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | using System.Data; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | using DesktopComposer.Implementation; 10 | using Tulpep.ActiveDirectoryObjectPicker; 11 | using System.Collections; 12 | using System.Security.Principal; 13 | using static System.Windows.Forms.ListView; 14 | 15 | namespace ComposerAdmin.Forms 16 | { 17 | public partial class ACLEditorControl : UserControl 18 | { 19 | private ACLs _ACLs; 20 | 21 | [Browsable(true)] 22 | [Category("Action")] 23 | [Description("Invoked when Item Selection changes")] 24 | public event System.EventHandler ItemSelectionChanged; 25 | public ACLs ACLs 26 | { 27 | get 28 | { 29 | return _ACLs; 30 | } 31 | set 32 | { 33 | _ACLs = value; 34 | Render(); 35 | } 36 | } 37 | 38 | // Workaround for delete/edit 39 | public int SelectedItemCount 40 | { 41 | get => lv.SelectedItems.Count; 42 | } 43 | public ACLEditorControl() 44 | { 45 | InitializeComponent(); 46 | } 47 | 48 | public void Render() 49 | { 50 | ListViewItem li; 51 | if (_ACLs != null) { 52 | foreach (ACL acl in _ACLs) 53 | { 54 | if (!lv.Items.ContainsKey(acl.ObjectID.ToString())) { 55 | li = lv.Items.Add(acl.ObjectID.ToString(), acl.ObjectShortName,0); 56 | li.Tag = acl; 57 | RefreshListItem(li); 58 | } 59 | } 60 | } 61 | } 62 | 63 | private void RefreshListItem(ListViewItem Litem) 64 | { 65 | ACL acl = (ACL)Litem.Tag; 66 | //Icon 67 | Litem.Text = acl.ObjectShortName; 68 | int imIndex=0; 69 | 70 | if (acl.ObjectType == ACLObjectType.User) 71 | imIndex = 0; 72 | else 73 | imIndex = 1; 74 | 75 | if (acl.Disabled) 76 | { 77 | imIndex += 4; 78 | } else { 79 | if (acl.ACLType == ACLType.Deny) 80 | imIndex += 2; 81 | } 82 | 83 | Litem.ImageIndex = imIndex; 84 | } 85 | 86 | private string SIDBytesToString(byte[] bytes) 87 | { 88 | try 89 | { 90 | var sid = new SecurityIdentifier(bytes, 0); 91 | return sid.ToString(); 92 | } 93 | // ReSharper disable once EmptyGeneralCatchClause 94 | catch (Exception) 95 | { 96 | } 97 | 98 | return BytesToString(bytes); 99 | } 100 | 101 | private string BytesToString(byte[] bytes) 102 | { 103 | return "0x" + BitConverter.ToString(bytes).Replace('-', ' '); 104 | } 105 | 106 | public void ACLDelete() 107 | { 108 | ACL SelACL; 109 | foreach (ListViewItem i in lv.SelectedItems){ 110 | SelACL = (ACL)i.Tag; 111 | ACLs.Remove(SelACL); 112 | i.Remove(); 113 | } 114 | } 115 | 116 | public void OpenADPicker() 117 | { 118 | ACL addACL; 119 | int i, j; 120 | 121 | string objectSID; 122 | string objectName; 123 | string objectUPN; 124 | ACLObjectType objectType; 125 | string objectPath; 126 | objectType = ACLObjectType.User; 127 | 128 | 129 | ADPicker.AllowedObjectTypes = ObjectTypes.Users | ObjectTypes.Groups; 130 | ADPicker.DefaultObjectTypes = ObjectTypes.Users | ObjectTypes.Groups; 131 | ADPicker.AllowedLocations = Locations.All; 132 | ADPicker.DefaultLocations = Locations.LocalComputer; 133 | //ADPicker.DefaultLocations = Locations.JoinedDomain; 134 | ADPicker.MultiSelect = true; 135 | ADPicker.ShowAdvancedView = true; 136 | 137 | if (ADPicker.ShowDialog(this) == DialogResult.OK) 138 | { 139 | DirectoryObject[] results = ADPicker.SelectedObjects; 140 | 141 | 142 | for (i=0; i < results.Length; i++) 143 | { 144 | objectName = results[i].Name; 145 | objectUPN = results[i].Upn; 146 | objectSID = ""; 147 | objectPath = results[i].Path; 148 | 149 | //Object Type 150 | switch (results[i].SchemaClassName.ToLower()) 151 | { 152 | case "user": 153 | objectType = ACLObjectType.User; 154 | break; 155 | 156 | case "group": 157 | objectType = ACLObjectType.Group; 158 | break; 159 | } 160 | 161 | //Fetch Attributes 162 | for (j = 0; j < results[i].FetchedAttributes.Length; j++) { 163 | 164 | var attributeName = ADPicker.AttributesToFetch[j]; 165 | Console.WriteLine("Found Attribute Name: {0}", attributeName); 166 | 167 | var multivaluedAttribute = results[i].FetchedAttributes[j]; 168 | 169 | if (!(multivaluedAttribute is IEnumerable) || multivaluedAttribute is byte[] || multivaluedAttribute is string) 170 | multivaluedAttribute = new[] { multivaluedAttribute }; 171 | 172 | foreach (var attribute in (IEnumerable)multivaluedAttribute) 173 | { 174 | if (attributeName.Equals("objectSid", StringComparison.OrdinalIgnoreCase)) 175 | objectSID = SIDBytesToString((byte[])attribute); 176 | } 177 | } 178 | 179 | //Check if ACL Exists 180 | if (ACLs[objectSID] == null) 181 | { 182 | addACL = new ACL() { 183 | SID = objectSID, 184 | //ObjectName = objectName, 185 | ObjectName = _resolveSID(objectSID), 186 | ObjectPath = objectPath, 187 | ObjectType = objectType, 188 | ObjectID = Guid.NewGuid() 189 | }; 190 | _ACLs.Add(addACL); 191 | Render(); 192 | } 193 | 194 | 195 | } 196 | } 197 | } 198 | 199 | private static string _resolveSID(string sObjectSID) { 200 | SecurityIdentifier s = new SecurityIdentifier(sObjectSID); 201 | string objectname = s.Translate(typeof(NTAccount)).Value; 202 | Console.WriteLine(objectname); 203 | return objectname; 204 | } 205 | private void lv_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e) 206 | { 207 | ItemSelectionChanged(sender, e); 208 | } 209 | 210 | private void DenySelected(bool value) 211 | { 212 | ACL acl; 213 | foreach (ListViewItem li in lv.SelectedItems) 214 | { 215 | acl = (ACL)li.Tag; 216 | if (value) 217 | acl.ACLType = ACLType.Deny; 218 | else 219 | acl.ACLType = ACLType.Allow; 220 | 221 | RefreshListItem(li); 222 | } 223 | } 224 | 225 | private void DisableSelected(bool value) 226 | { 227 | ACL acl; 228 | foreach (ListViewItem li in lv.SelectedItems) 229 | { 230 | acl = (ACL)li.Tag; 231 | acl.Disabled = value; 232 | RefreshListItem(li); 233 | } 234 | } 235 | 236 | private void CtxMenu_CheckChanged(object sender, EventArgs e) 237 | { 238 | ToolStripMenuItem mnuI = (ToolStripMenuItem)sender; 239 | switch (mnuI.Name) 240 | { 241 | case "ctxMenuDeny": 242 | DenySelected(mnuI.Checked); 243 | break; 244 | 245 | case "ctxMenuDisabled": 246 | DisableSelected(mnuI.Checked); 247 | break; 248 | } 249 | } 250 | 251 | private void ctxMenu_Open(object sender, CancelEventArgs e) 252 | { 253 | if (lv.SelectedItems.Count == 1) 254 | { 255 | ACL acl = (ACL)lv.SelectedItems[0].Tag; 256 | ctxMenuDisabled.Checked = acl.Disabled; 257 | ctxMenuDeny.Checked = (acl.ACLType == ACLType.Allow) ? false : true; 258 | } else 259 | { 260 | ctxMenuDeny.Checked = false; 261 | ctxMenuDisabled.Checked = false; 262 | } 263 | } 264 | } 265 | } 266 | -------------------------------------------------------------------------------- /ComposerAdmin/Forms/FormAbout.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace ComposerAdmin.Forms 2 | { 3 | partial class FormAbout 4 | { 5 | /// 6 | /// Variabile di progettazione necessaria. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Pulire le risorse in uso. 12 | /// 13 | protected override void Dispose(bool disposing) 14 | { 15 | if (disposing && (components != null)) 16 | { 17 | components.Dispose(); 18 | } 19 | base.Dispose(disposing); 20 | } 21 | 22 | #region Codice generato da Progettazione Windows Form 23 | 24 | /// 25 | /// Metodo necessario per il supporto della finestra di progettazione. Non modificare 26 | /// il contenuto del metodo con l'editor di codice. 27 | /// 28 | private void InitializeComponent() 29 | { 30 | this.panel1 = new System.Windows.Forms.Panel(); 31 | this.labelProductName = new System.Windows.Forms.Label(); 32 | this.labelProductTitle = new System.Windows.Forms.Label(); 33 | this.labelVersion = new System.Windows.Forms.Label(); 34 | this.labelCompanyName = new System.Windows.Forms.Label(); 35 | this.labelCopyright = new System.Windows.Forms.Label(); 36 | this.pictureBox1 = new System.Windows.Forms.PictureBox(); 37 | this.textBoxDescription1 = new System.Windows.Forms.TextBox(); 38 | this.okButton = new System.Windows.Forms.Button(); 39 | this.panel1.SuspendLayout(); 40 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); 41 | this.SuspendLayout(); 42 | // 43 | // panel1 44 | // 45 | this.panel1.BackColor = System.Drawing.Color.White; 46 | this.panel1.Controls.Add(this.labelProductName); 47 | this.panel1.Controls.Add(this.labelProductTitle); 48 | this.panel1.Controls.Add(this.labelVersion); 49 | this.panel1.Controls.Add(this.labelCompanyName); 50 | this.panel1.Controls.Add(this.labelCopyright); 51 | this.panel1.Controls.Add(this.pictureBox1); 52 | this.panel1.Location = new System.Drawing.Point(1, 0); 53 | this.panel1.Name = "panel1"; 54 | this.panel1.Size = new System.Drawing.Size(380, 112); 55 | this.panel1.TabIndex = 1; 56 | // 57 | // labelProductName 58 | // 59 | this.labelProductName.AutoSize = true; 60 | this.labelProductName.Location = new System.Drawing.Point(128, 28); 61 | this.labelProductName.Name = "labelProductName"; 62 | this.labelProductName.Size = new System.Drawing.Size(67, 13); 63 | this.labelProductName.TabIndex = 27; 64 | this.labelProductName.Text = "Product Title"; 65 | // 66 | // labelProductTitle 67 | // 68 | this.labelProductTitle.AutoSize = true; 69 | this.labelProductTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 70 | this.labelProductTitle.Location = new System.Drawing.Point(128, 9); 71 | this.labelProductTitle.Name = "labelProductTitle"; 72 | this.labelProductTitle.Size = new System.Drawing.Size(80, 13); 73 | this.labelProductTitle.TabIndex = 26; 74 | this.labelProductTitle.Text = "Product Title"; 75 | // 76 | // labelVersion 77 | // 78 | this.labelVersion.AutoSize = true; 79 | this.labelVersion.Location = new System.Drawing.Point(128, 47); 80 | this.labelVersion.Name = "labelVersion"; 81 | this.labelVersion.Size = new System.Drawing.Size(51, 13); 82 | this.labelVersion.TabIndex = 25; 83 | this.labelVersion.Text = "Copyright"; 84 | // 85 | // labelCompanyName 86 | // 87 | this.labelCompanyName.AutoSize = true; 88 | this.labelCompanyName.Location = new System.Drawing.Point(128, 85); 89 | this.labelCompanyName.Name = "labelCompanyName"; 90 | this.labelCompanyName.Size = new System.Drawing.Size(82, 13); 91 | this.labelCompanyName.TabIndex = 24; 92 | this.labelCompanyName.Text = "Company Name"; 93 | // 94 | // labelCopyright 95 | // 96 | this.labelCopyright.AutoSize = true; 97 | this.labelCopyright.Location = new System.Drawing.Point(128, 66); 98 | this.labelCopyright.Name = "labelCopyright"; 99 | this.labelCopyright.Size = new System.Drawing.Size(51, 13); 100 | this.labelCopyright.TabIndex = 23; 101 | this.labelCopyright.Text = "Copyright"; 102 | // 103 | // pictureBox1 104 | // 105 | this.pictureBox1.Image = global::ComposerAdmin.Properties.Resources.ApplicationIcon; 106 | this.pictureBox1.Location = new System.Drawing.Point(8, 7); 107 | this.pictureBox1.Name = "pictureBox1"; 108 | this.pictureBox1.Size = new System.Drawing.Size(100, 97); 109 | this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; 110 | this.pictureBox1.TabIndex = 0; 111 | this.pictureBox1.TabStop = false; 112 | // 113 | // textBoxDescription1 114 | // 115 | this.textBoxDescription1.Location = new System.Drawing.Point(1, 118); 116 | this.textBoxDescription1.Margin = new System.Windows.Forms.Padding(6, 3, 3, 3); 117 | this.textBoxDescription1.Multiline = true; 118 | this.textBoxDescription1.Name = "textBoxDescription1"; 119 | this.textBoxDescription1.ReadOnly = true; 120 | this.textBoxDescription1.ScrollBars = System.Windows.Forms.ScrollBars.Both; 121 | this.textBoxDescription1.Size = new System.Drawing.Size(380, 105); 122 | this.textBoxDescription1.TabIndex = 27; 123 | this.textBoxDescription1.TabStop = false; 124 | this.textBoxDescription1.Text = "Descrizione"; 125 | // 126 | // okButton 127 | // 128 | this.okButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; 129 | this.okButton.Location = new System.Drawing.Point(306, 235); 130 | this.okButton.Name = "okButton"; 131 | this.okButton.Size = new System.Drawing.Size(75, 23); 132 | this.okButton.TabIndex = 28; 133 | this.okButton.Text = "&OK"; 134 | this.okButton.UseVisualStyleBackColor = true; 135 | // 136 | // FormAbout 137 | // 138 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 139 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 140 | this.ClientSize = new System.Drawing.Size(383, 264); 141 | this.Controls.Add(this.okButton); 142 | this.Controls.Add(this.textBoxDescription1); 143 | this.Controls.Add(this.panel1); 144 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 145 | this.MaximizeBox = false; 146 | this.MinimizeBox = false; 147 | this.Name = "FormAbout"; 148 | this.Padding = new System.Windows.Forms.Padding(9); 149 | this.ShowIcon = false; 150 | this.ShowInTaskbar = false; 151 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 152 | this.Text = "FormAbout"; 153 | this.panel1.ResumeLayout(false); 154 | this.panel1.PerformLayout(); 155 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); 156 | this.ResumeLayout(false); 157 | this.PerformLayout(); 158 | 159 | } 160 | 161 | #endregion 162 | private System.Windows.Forms.Panel panel1; 163 | private System.Windows.Forms.PictureBox pictureBox1; 164 | private System.Windows.Forms.Label labelCompanyName; 165 | private System.Windows.Forms.Label labelCopyright; 166 | private System.Windows.Forms.Label labelVersion; 167 | private System.Windows.Forms.TextBox textBoxDescription1; 168 | private System.Windows.Forms.Button okButton; 169 | private System.Windows.Forms.Label labelProductName; 170 | private System.Windows.Forms.Label labelProductTitle; 171 | } 172 | } 173 | -------------------------------------------------------------------------------- /ComposerAdmin/Forms/FormAbout.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Reflection; 8 | using System.Windows.Forms; 9 | using ComposerAdmin.Properties; 10 | 11 | namespace ComposerAdmin.Forms 12 | { 13 | partial class FormAbout : Form 14 | { 15 | public FormAbout() 16 | { 17 | InitializeComponent(); 18 | this.Text = String.Format(Resources.ABOUT_FORM_ABOUT, AssemblyTitle); 19 | this.labelProductTitle.Text = AssemblyTitle; 20 | this.labelProductName.Text = AssemblyProduct; 21 | this.labelVersion.Text = String.Format(Resources.ABOUT_LABEL_VERSION, AssemblyVersion); 22 | this.labelCopyright.Text = AssemblyCopyright; 23 | this.labelCompanyName.Text = AssemblyCompany; 24 | this.textBoxDescription1.Text = getLicenseFileDescription(); 25 | } 26 | 27 | private string getLicenseFileDescription() 28 | { 29 | string LicenseFile = Path.GetDirectoryName(new System.Uri(System.Reflection.Assembly.GetExecutingAssembly().CodeBase).LocalPath) + @"\LICENSE"; 30 | 31 | if (File.Exists(LicenseFile)) 32 | { 33 | return File.ReadAllText(LicenseFile); 34 | } 35 | return Resources.MESSAGE_UNABLE_TO_RETRIEVE_LICENSE_FILE; 36 | } 37 | 38 | #region Funzioni di accesso attributo assembly 39 | 40 | public string AssemblyTitle 41 | { 42 | get 43 | { 44 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false); 45 | if (attributes.Length > 0) 46 | { 47 | AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0]; 48 | if (String.IsNullOrEmpty(titleAttribute.Title)) 49 | { 50 | return titleAttribute.Title; 51 | } 52 | } 53 | return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase); 54 | } 55 | } 56 | 57 | public string AssemblyVersion 58 | { 59 | get 60 | { 61 | return Assembly.GetExecutingAssembly().GetName().Version.ToString(); 62 | } 63 | } 64 | 65 | public string AssemblyDescription 66 | { 67 | get 68 | { 69 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false); 70 | if (attributes.Length == 0) 71 | { 72 | return ""; 73 | } 74 | return ((AssemblyDescriptionAttribute)attributes[0]).Description; 75 | } 76 | } 77 | 78 | public string AssemblyProduct 79 | { 80 | get 81 | { 82 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false); 83 | if (attributes.Length == 0) 84 | { 85 | return ""; 86 | } 87 | return ((AssemblyProductAttribute)attributes[0]).Product; 88 | } 89 | } 90 | 91 | public string AssemblyCopyright 92 | { 93 | get 94 | { 95 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); 96 | if (attributes.Length == 0) 97 | { 98 | return ""; 99 | } 100 | return ((AssemblyCopyrightAttribute)attributes[0]).Copyright; 101 | } 102 | } 103 | 104 | public string AssemblyCompany 105 | { 106 | get 107 | { 108 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false); 109 | if (attributes.Length == 0) 110 | { 111 | return ""; 112 | } 113 | return ((AssemblyCompanyAttribute)attributes[0]).Company; 114 | } 115 | } 116 | #endregion 117 | 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /ComposerAdmin/Forms/FormAbout.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 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 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /ComposerAdmin/Forms/FormInputNetworkPath.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace ComposerAdmin.Forms 2 | { 3 | partial class FormInputNetworkPath 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormInputNetworkPath)); 32 | this.TextComputerName = new System.Windows.Forms.TextBox(); 33 | this.label1 = new System.Windows.Forms.Label(); 34 | this.btnOK = new System.Windows.Forms.Button(); 35 | this.btnCancel = new System.Windows.Forms.Button(); 36 | this.SuspendLayout(); 37 | // 38 | // TextComputerName 39 | // 40 | resources.ApplyResources(this.TextComputerName, "TextComputerName"); 41 | this.TextComputerName.Name = "TextComputerName"; 42 | // 43 | // label1 44 | // 45 | resources.ApplyResources(this.label1, "label1"); 46 | this.label1.Name = "label1"; 47 | // 48 | // btnOK 49 | // 50 | resources.ApplyResources(this.btnOK, "btnOK"); 51 | this.btnOK.Name = "btnOK"; 52 | this.btnOK.UseVisualStyleBackColor = true; 53 | this.btnOK.Click += new System.EventHandler(this.btnOK_Click); 54 | // 55 | // btnCancel 56 | // 57 | this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; 58 | resources.ApplyResources(this.btnCancel, "btnCancel"); 59 | this.btnCancel.Name = "btnCancel"; 60 | this.btnCancel.UseVisualStyleBackColor = true; 61 | // 62 | // FormInputNetworkPath 63 | // 64 | this.AcceptButton = this.btnOK; 65 | resources.ApplyResources(this, "$this"); 66 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 67 | this.CancelButton = this.btnCancel; 68 | this.Controls.Add(this.btnCancel); 69 | this.Controls.Add(this.btnOK); 70 | this.Controls.Add(this.label1); 71 | this.Controls.Add(this.TextComputerName); 72 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 73 | this.MaximizeBox = false; 74 | this.MinimizeBox = false; 75 | this.Name = "FormInputNetworkPath"; 76 | this.ResumeLayout(false); 77 | this.PerformLayout(); 78 | 79 | } 80 | 81 | #endregion 82 | 83 | private System.Windows.Forms.TextBox TextComputerName; 84 | private System.Windows.Forms.Label label1; 85 | private System.Windows.Forms.Button btnOK; 86 | private System.Windows.Forms.Button btnCancel; 87 | } 88 | } -------------------------------------------------------------------------------- /ComposerAdmin/Forms/FormInputNetworkPath.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.IO; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Windows.Forms; 10 | using ComposerAdmin.Properties; 11 | 12 | namespace ComposerAdmin.Forms 13 | { 14 | public partial class FormInputNetworkPath : Form 15 | { 16 | string _networkPath; 17 | public FormInputNetworkPath() 18 | { 19 | _networkPath = null; 20 | InitializeComponent(); 21 | } 22 | 23 | private void btnOK_Click(object sender, EventArgs e) 24 | { 25 | //Check if Network Path For Stert Menu Exists 26 | string lPath = @"\\" + TextComputerName.Text + @"\C$\ProgramData\Microsoft\Windows\Start Menu"; 27 | if (Directory.Exists(lPath)) 28 | { 29 | _networkPath = lPath; 30 | this.Close(); 31 | } else 32 | { 33 | MessageBox.Show(Resources.MESSAGE_PATH_NOT_FOUND, Resources.MESSAGE_PATH_NOT_FOUND, MessageBoxButtons.OK, MessageBoxIcon.Error); 34 | } 35 | 36 | } 37 | public string ShowDialogNetworkPath() 38 | { 39 | this.ShowDialog(); 40 | return _networkPath; 41 | } 42 | } 43 | 44 | 45 | } 46 | -------------------------------------------------------------------------------- /ComposerAdmin/Forms/FormSettings.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace WinComposer.Forms 2 | { 3 | partial class FormSettings 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.SuspendLayout(); 32 | // 33 | // FormSettings 34 | // 35 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 36 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 37 | this.ClientSize = new System.Drawing.Size(450, 408); 38 | this.Name = "FormSettings"; 39 | this.Text = "FormSettings"; 40 | this.ResumeLayout(false); 41 | 42 | } 43 | 44 | #endregion 45 | } 46 | } -------------------------------------------------------------------------------- /ComposerAdmin/Forms/FormSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | 10 | namespace WinComposer.Forms 11 | { 12 | public partial class FormSettings : Form 13 | { 14 | public FormSettings() 15 | { 16 | InitializeComponent(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ComposerAdmin/Forms/FormSettings.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 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 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /ComposerAdmin/Forms/FormShortcutProperties.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Windows.Forms; 4 | using DesktopComposer.Implementation; 5 | using ComposerAdmin.Properties; 6 | using System.Drawing; 7 | using DesktopComposer; 8 | 9 | namespace ComposerAdmin.Forms 10 | { 11 | public partial class FormShortcutProperties : Form 12 | { 13 | private DesktopComposer.Implementation.Shortcut _shortcut; 14 | private ACLs _acls; 15 | private Icon _tempIcon; 16 | private string _tempIconLocation; 17 | public FormShortcutProperties() 18 | { 19 | InitializeComponent(); 20 | aclEditor.ItemSelectionChanged += new EventHandler(aclEditor_ItemSelectionChanged); 21 | 22 | btnACLDelete.Enabled = false; 23 | Dictionary WinModes = new Dictionary(); 24 | WinModes.Add("1", Resources.WINDOWMODE_NORMAL); 25 | WinModes.Add("3", Resources.WINDOWMODE_MINIMIZED); 26 | WinModes.Add("7", Resources.WINDOWMODE_MAXIMIZED); 27 | comboWinMode.DataSource = new BindingSource(WinModes, null); 28 | comboWinMode.DisplayMember = "Value"; 29 | comboWinMode.ValueMember = "Key"; 30 | } 31 | 32 | private void aclEditor_ItemSelectionChanged(object sender, EventArgs e) 33 | { 34 | if (aclEditor.SelectedItemCount > 0) 35 | btnACLDelete.Enabled = true; 36 | else 37 | btnACLDelete.Enabled = false; 38 | } 39 | 40 | private void label3_Click(object sender, EventArgs e) 41 | { 42 | 43 | } 44 | 45 | private void FormShortcutProperties_Load(object sender, EventArgs e) 46 | { 47 | 48 | } 49 | public DialogResult ShowDialog(DesktopComposer.Implementation.Shortcut shortcut) 50 | { 51 | if (shortcut == null) return DialogResult.Cancel; 52 | 53 | _shortcut = shortcut; 54 | _acls = (ACLs)shortcut.ACLs.Clone(); 55 | 56 | textDisplayName.Text = _shortcut.DisplayName; 57 | textTarget.Text = _shortcut.TargetPath; 58 | textArguments.Text = _shortcut.Arguments; 59 | textHotkey.Text = _shortcut.Hotkey; 60 | textWorkingDirectory.Text = _shortcut.WorkingDirectory; 61 | aclEditor.ACLs = _acls; 62 | 63 | chkPinOnTaskBar.Checked = _shortcut.PutOnTaskBar; 64 | chkPutOnDesktop.Checked = _shortcut.PutOnDesktop; 65 | chkPutOnStartMenu.Checked = _shortcut.PutOnStartMenu; 66 | chkDeployDisabled.Checked = _shortcut.DeployDisabled; 67 | chkAclDenyByDefault.Checked = _shortcut.ACLDenyByDefault; 68 | chkCheckIfTargetExists.Checked = _shortcut.CheckIfTargetExists; 69 | 70 | comboWinMode.SelectedValue = _shortcut.WindowStyle.ToString(); 71 | 72 | if (_shortcut.IconCacheLarge != null) 73 | pBIcon.Image = _shortcut.IconCacheLarge.ToBitmap(); 74 | 75 | _tempIcon = null; 76 | 77 | return this.ShowDialog(); 78 | } 79 | 80 | 81 | private void BtnACLAdd_Click(object sender, EventArgs e) 82 | { 83 | aclEditor.OpenADPicker(); 84 | } 85 | 86 | private void btnOK_Click(object sender, EventArgs e) 87 | { 88 | _shortcut.DisplayName=(textDisplayName.Text); 89 | _shortcut.TargetPath = textTarget.Text; 90 | _shortcut.Arguments = textArguments.Text; 91 | _shortcut.Hotkey = textHotkey.Text; 92 | _shortcut.WorkingDirectory = textWorkingDirectory.Text; 93 | _shortcut.PutOnStartMenu = chkPutOnStartMenu.Checked; 94 | _shortcut.PutOnTaskBar = chkPinOnTaskBar.Checked; 95 | _shortcut.PutOnDesktop = chkPutOnDesktop.Checked; 96 | _shortcut.DeployDisabled = chkDeployDisabled.Checked; 97 | _shortcut.ACLDenyByDefault = chkAclDenyByDefault.Checked; 98 | _shortcut.WindowStyle = int.Parse(comboWinMode.SelectedValue.ToString()); 99 | _shortcut.CheckIfTargetExists = chkCheckIfTargetExists.Checked; 100 | _shortcut.ACLs = _acls; 101 | 102 | if (_tempIconLocation != null) { 103 | _shortcut.IconLocation = _tempIconLocation; 104 | _shortcut.FindIcon(); 105 | } 106 | 107 | this.Close(); 108 | } 109 | 110 | private void btnCancel_Click(object sender, EventArgs e) 111 | { 112 | this.Close(); 113 | } 114 | 115 | private void btnACLDelete_Click(object sender, EventArgs e) 116 | { 117 | aclEditor.ACLDelete(); 118 | } 119 | 120 | private void btnChangeIcon_Click(object sender, EventArgs e) 121 | { 122 | DialogResult result = iconPickerDialog.ShowDialog(this); 123 | if (result == DialogResult.OK) 124 | { 125 | _tempIconLocation = iconPickerDialog.FileName + "," + iconPickerDialog.IconIndex.ToString(); 126 | _tempIcon = ShellIcon.IconExtract(iconPickerDialog.FileName, iconPickerDialog.IconIndex, 1); 127 | 128 | _shortcut.FindIcon(); 129 | if (_shortcut.IconCacheLarge != null) 130 | pBIcon.Image = _tempIcon.ToBitmap(); 131 | 132 | } 133 | iconPickerDialog.Dispose(); 134 | } 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /ComposerAdmin/Forms/StartMenuEditorControl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace ComposerAdmin.Forms 2 | { 3 | partial class StartMenuEditorControl 4 | { 5 | /// 6 | /// Variabile di progettazione necessaria. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Pulire le risorse in uso. 12 | /// 13 | /// ha valore true se le risorse gestite devono essere eliminate, false in caso contrario. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Codice generato da Progettazione componenti 24 | 25 | /// 26 | /// Metodo necessario per il supporto della finestra di progettazione. Non modificare 27 | /// il contenuto del metodo con l'editor di codice. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(StartMenuEditorControl)); 33 | this.tvStartMenu = new System.Windows.Forms.TreeView(); 34 | this.ctxMenu = new System.Windows.Forms.ContextMenuStrip(this.components); 35 | this.mniAddShortcut = new System.Windows.Forms.ToolStripMenuItem(); 36 | this.mniAddMenu = new System.Windows.Forms.ToolStripMenuItem(); 37 | this.mniDelete = new System.Windows.Forms.ToolStripMenuItem(); 38 | this.mniRename = new System.Windows.Forms.ToolStripMenuItem(); 39 | this.mniProperties = new System.Windows.Forms.ToolStripMenuItem(); 40 | this.imlIcons = new System.Windows.Forms.ImageList(this.components); 41 | this.ctxMenu.SuspendLayout(); 42 | this.SuspendLayout(); 43 | // 44 | // tvStartMenu 45 | // 46 | this.tvStartMenu.AllowDrop = true; 47 | this.tvStartMenu.ContextMenuStrip = this.ctxMenu; 48 | this.tvStartMenu.Dock = System.Windows.Forms.DockStyle.Fill; 49 | this.tvStartMenu.ImageIndex = 0; 50 | this.tvStartMenu.ImageList = this.imlIcons; 51 | this.tvStartMenu.LabelEdit = true; 52 | this.tvStartMenu.Location = new System.Drawing.Point(0, 0); 53 | this.tvStartMenu.Name = "tvStartMenu"; 54 | this.tvStartMenu.SelectedImageIndex = 0; 55 | this.tvStartMenu.Size = new System.Drawing.Size(287, 180); 56 | this.tvStartMenu.TabIndex = 0; 57 | this.tvStartMenu.BeforeLabelEdit += new System.Windows.Forms.NodeLabelEditEventHandler(this.NodeBeforeLabelEdit); 58 | this.tvStartMenu.AfterLabelEdit += new System.Windows.Forms.NodeLabelEditEventHandler(this.tvNodeAfterLabelEdit); 59 | this.tvStartMenu.AfterCollapse += new System.Windows.Forms.TreeViewEventHandler(this.tvNodeExpandCollapse); 60 | this.tvStartMenu.AfterExpand += new System.Windows.Forms.TreeViewEventHandler(this.tvNodeExpandCollapse); 61 | this.tvStartMenu.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.tvItemDrag); 62 | this.tvStartMenu.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tvNodeAfterSelect); 63 | this.tvStartMenu.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.NodeMouseClick); 64 | this.tvStartMenu.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.NodeDoubleClick); 65 | this.tvStartMenu.DragDrop += new System.Windows.Forms.DragEventHandler(this.tvDragDrop); 66 | this.tvStartMenu.DragEnter += new System.Windows.Forms.DragEventHandler(this.tvDragEnter); 67 | this.tvStartMenu.DragOver += new System.Windows.Forms.DragEventHandler(this.tvDragOver); 68 | // 69 | // ctxMenu 70 | // 71 | this.ctxMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 72 | this.mniAddShortcut, 73 | this.mniAddMenu, 74 | this.mniDelete, 75 | this.mniRename, 76 | this.mniProperties}); 77 | this.ctxMenu.Name = "ctxMenu"; 78 | this.ctxMenu.Size = new System.Drawing.Size(148, 114); 79 | // 80 | // mniAddShortcut 81 | // 82 | this.mniAddShortcut.Name = "mniAddShortcut"; 83 | this.mniAddShortcut.Size = new System.Drawing.Size(147, 22); 84 | this.mniAddShortcut.Text = "Add Shortcut"; 85 | this.mniAddShortcut.Click += new System.EventHandler(this.mniContextClick); 86 | // 87 | // mniAddMenu 88 | // 89 | this.mniAddMenu.Name = "mniAddMenu"; 90 | this.mniAddMenu.Size = new System.Drawing.Size(147, 22); 91 | this.mniAddMenu.Text = "Add Menu"; 92 | this.mniAddMenu.Click += new System.EventHandler(this.mniContextClick); 93 | // 94 | // mniDelete 95 | // 96 | this.mniDelete.Name = "mniDelete"; 97 | this.mniDelete.ShortcutKeys = System.Windows.Forms.Keys.Delete; 98 | this.mniDelete.Size = new System.Drawing.Size(147, 22); 99 | this.mniDelete.Text = "Delete"; 100 | this.mniDelete.Click += new System.EventHandler(this.mniContextClick); 101 | // 102 | // mniRename 103 | // 104 | this.mniRename.Name = "mniRename"; 105 | this.mniRename.ShortcutKeys = System.Windows.Forms.Keys.F2; 106 | this.mniRename.Size = new System.Drawing.Size(147, 22); 107 | this.mniRename.Text = "Rename"; 108 | this.mniRename.Click += new System.EventHandler(this.mniContextClick); 109 | // 110 | // mniProperties 111 | // 112 | this.mniProperties.Name = "mniProperties"; 113 | this.mniProperties.Size = new System.Drawing.Size(147, 22); 114 | this.mniProperties.Text = "Properties"; 115 | this.mniProperties.Click += new System.EventHandler(this.mniContextClick); 116 | // 117 | // imlIcons 118 | // 119 | this.imlIcons.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imlIcons.ImageStream"))); 120 | this.imlIcons.TransparentColor = System.Drawing.Color.Transparent; 121 | this.imlIcons.Images.SetKeyName(0, "START"); 122 | // 123 | // StartMenuEditorControl 124 | // 125 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 126 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 127 | this.Controls.Add(this.tvStartMenu); 128 | this.Name = "StartMenuEditorControl"; 129 | this.Size = new System.Drawing.Size(287, 180); 130 | this.ctxMenu.ResumeLayout(false); 131 | this.ResumeLayout(false); 132 | 133 | } 134 | 135 | #endregion 136 | private System.Windows.Forms.ImageList imlIcons; 137 | private System.Windows.Forms.ContextMenuStrip ctxMenu; 138 | private System.Windows.Forms.ToolStripMenuItem mniAddShortcut; 139 | private System.Windows.Forms.ToolStripMenuItem mniAddMenu; 140 | private System.Windows.Forms.ToolStripMenuItem mniDelete; 141 | private System.Windows.Forms.ToolStripMenuItem mniProperties; 142 | private System.Windows.Forms.TreeView tvStartMenu; 143 | private System.Windows.Forms.ToolStripMenuItem mniRename; 144 | } 145 | } 146 | -------------------------------------------------------------------------------- /ComposerAdmin/Forms/StartMenuEditorControl.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 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 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 238, 17 122 | 123 | 124 | 141, 17 125 | 126 | 127 | 128 | AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w 129 | LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 130 | ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABm 131 | AQAAAk1TRnQBSQFMAwEBAAE4AQABOAEAARABAAEQAQAE/wEZAQAI/wFCAU0BNgcAATYDAAEoAwABQAMA 132 | ARADAAEBAQABGAYAAQw2AAP+A/YD3APEnwAD/QPyA/sDpQNbAxoMAANWkwADbwMyAwcJAAPyFQADVqUA 133 | A/IVAANWpQAD8hUAA1alAAPyFQADVqUAA/IVAANWkwAD0QzTA9ID/RXsA/GWAAwEAwAD7gMFEgcDdaUA 134 | A+sVAANypQAD6BUAA3KlAAPkFQADcqUAA+EVAANykwAD/APwA88DkQNKAw8D3BUAA3KoAAP+A/QD1QOY 135 | A08DFAMAA3K9AAP+kAABQgFNAT4HAAE+AwABKAMAAUADAAEQAwABAQEAAQEFAAGAFwAD/wEAAf8B8AYA 136 | AfgHAAGABwABgAcAAYAHAAGABwABgAcAAYAHAAGABwABgAcAAYAHAAGABwABgAcAAYAHAAH/BwAB/wH+ 137 | BgAL 138 | 139 | 140 | -------------------------------------------------------------------------------- /ComposerAdmin/IconPickerDialog.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using System.Runtime.InteropServices; 4 | using System.Security; 5 | using System.Text; 6 | using System.Windows.Forms; 7 | 8 | namespace ComposerAdmin 9 | { 10 | public class IconPickerDialog : CommonDialog 11 | { 12 | private static class NativeMethods 13 | { 14 | [DllImport("shell32.dll", EntryPoint = "#62", CharSet = CharSet.Unicode, SetLastError = true)] 15 | [SuppressUnmanagedCodeSecurity] 16 | public static extern bool SHPickIconDialog( 17 | IntPtr hWnd, StringBuilder pszFilename, int cchFilenameMax, out int pnIconIndex); 18 | } 19 | 20 | private const int MAX_PATH = 260; 21 | 22 | [DefaultValue(default(string))] 23 | public string FileName 24 | { 25 | get; 26 | set; 27 | } 28 | 29 | [DefaultValue(0)] 30 | public int IconIndex 31 | { 32 | get; 33 | set; 34 | } 35 | 36 | protected override bool RunDialog(IntPtr hwndOwner) 37 | { 38 | var buf = new StringBuilder(FileName, MAX_PATH); 39 | int index; 40 | 41 | bool ok = NativeMethods.SHPickIconDialog(hwndOwner, buf, MAX_PATH, out index); 42 | if (ok) 43 | { 44 | FileName = Environment.ExpandEnvironmentVariables(buf.ToString()); 45 | IconIndex = index; 46 | } 47 | 48 | return ok; 49 | } 50 | 51 | public override void Reset() 52 | { 53 | FileName = null; 54 | IconIndex = 0; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /ComposerAdmin/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Windows.Forms; 5 | using ComposerAdmin.Forms; 6 | 7 | namespace ComposerAdmin 8 | { 9 | static class Program 10 | { 11 | /// 12 | /// Punto di ingresso principale dell'applicazione. 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | using (FormComposerEditor f = new FormComposerEditor()) 20 | { 21 | Application.Run(f); 22 | } 23 | } 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ComposerAdmin/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // Le informazioni generali relative a un assembly sono controllate dal seguente 6 | // set di attributi. Modificare i valori di questi attributi per modificare le informazioni 7 | // associate a un assembly. 8 | [assembly: AssemblyTitle("Composition Editor")] 9 | [assembly: AssemblyDescription("Start Menu Shortcuts Editor")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Sequence Software")] 12 | [assembly: AssemblyProduct("ComposerAdmin")] 13 | [assembly: AssemblyCopyright("Copyright © 2020 Riccardo Bicelli")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Se si imposta ComVisible su false, i tipi in questo assembly non saranno visibili 18 | // ai componenti COM. Se è necessario accedere a un tipo in questo assembly da 19 | // COM, impostare su true l'attributo ComVisible per tale tipo. 20 | [assembly: ComVisible(false)] 21 | 22 | // Se il progetto viene esposto a COM, il GUID seguente verrà utilizzato come ID della libreria dei tipi 23 | [assembly: Guid("d4cdc189-4e58-4c38-91da-650a4282f0b6")] 24 | 25 | // Le informazioni sulla versione di un assembly sono costituite dai seguenti quattro valori: 26 | // 27 | // Versione principale 28 | // Versione secondaria 29 | // Numero di build 30 | // Revisione 31 | // 32 | // È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build 33 | // usando l'asterisco '*' come illustrato di seguito: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("0.9.3.0")] 36 | [assembly: AssemblyFileVersion("0.9.3.0")] 37 | -------------------------------------------------------------------------------- /ComposerAdmin/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Il codice è stato generato da uno strumento. 4 | // Versione runtime:4.0.30319.42000 5 | // 6 | // Le modifiche apportate a questo file possono provocare un comportamento non corretto e andranno perse se 7 | // il codice viene rigenerato. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ComposerAdmin.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// Classe di risorse fortemente tipizzata per la ricerca di stringhe localizzate e così via. 17 | /// 18 | // Questa classe è stata generata automaticamente dalla classe StronglyTypedResourceBuilder. 19 | // tramite uno strumento quale ResGen o Visual Studio. 20 | // Per aggiungere o rimuovere un membro, modificare il file con estensione ResX ed eseguire nuovamente ResGen 21 | // con l'opzione /str oppure ricompilare il progetto VS. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Restituisce l'istanza di ResourceManager nella cache utilizzata da questa classe. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ComposerAdmin.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Esegue l'override della proprietà CurrentUICulture del thread corrente per tutte le 51 | /// ricerche di risorse eseguite utilizzando questa classe di risorse fortemente tipizzata. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap. 65 | /// 66 | internal static System.Drawing.Bitmap _new { 67 | get { 68 | object obj = ResourceManager.GetObject("_new", resourceCulture); 69 | return ((System.Drawing.Bitmap)(obj)); 70 | } 71 | } 72 | 73 | /// 74 | /// Cerca una stringa localizzata simile a About {0}. 75 | /// 76 | internal static string ABOUT_FORM_ABOUT { 77 | get { 78 | return ResourceManager.GetString("ABOUT_FORM_ABOUT", resourceCulture); 79 | } 80 | } 81 | 82 | /// 83 | /// Cerca una stringa localizzata simile a Version {0}. 84 | /// 85 | internal static string ABOUT_LABEL_VERSION { 86 | get { 87 | return ResourceManager.GetString("ABOUT_LABEL_VERSION", resourceCulture); 88 | } 89 | } 90 | 91 | /// 92 | /// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap. 93 | /// 94 | internal static System.Drawing.Bitmap ApplicationIcon { 95 | get { 96 | object obj = ResourceManager.GetObject("ApplicationIcon", resourceCulture); 97 | return ((System.Drawing.Bitmap)(obj)); 98 | } 99 | } 100 | 101 | /// 102 | /// Cerca una stringa localizzata simile a Desktop Composition Files |*.dcxml|All files (*.*)|*.*. 103 | /// 104 | internal static string COMPOSITION_FILE_FILTER { 105 | get { 106 | return ResourceManager.GetString("COMPOSITION_FILE_FILTER", resourceCulture); 107 | } 108 | } 109 | 110 | /// 111 | /// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap. 112 | /// 113 | internal static System.Drawing.Bitmap computer_go { 114 | get { 115 | object obj = ResourceManager.GetObject("computer_go", resourceCulture); 116 | return ((System.Drawing.Bitmap)(obj)); 117 | } 118 | } 119 | 120 | /// 121 | /// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap. 122 | /// 123 | internal static System.Drawing.Bitmap computer_link { 124 | get { 125 | object obj = ResourceManager.GetObject("computer_link", resourceCulture); 126 | return ((System.Drawing.Bitmap)(obj)); 127 | } 128 | } 129 | 130 | /// 131 | /// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap. 132 | /// 133 | internal static System.Drawing.Bitmap disk { 134 | get { 135 | object obj = ResourceManager.GetObject("disk", resourceCulture); 136 | return ((System.Drawing.Bitmap)(obj)); 137 | } 138 | } 139 | 140 | /// 141 | /// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap. 142 | /// 143 | internal static System.Drawing.Bitmap drive_disk { 144 | get { 145 | object obj = ResourceManager.GetObject("drive_disk", resourceCulture); 146 | return ((System.Drawing.Bitmap)(obj)); 147 | } 148 | } 149 | 150 | /// 151 | /// Cerca una stringa localizzata simile a New Composition File. 152 | /// 153 | internal static string FILE_NEW_LABEL { 154 | get { 155 | return ResourceManager.GetString("FILE_NEW_LABEL", resourceCulture); 156 | } 157 | } 158 | 159 | /// 160 | /// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap. 161 | /// 162 | internal static System.Drawing.Bitmap folder_link { 163 | get { 164 | object obj = ResourceManager.GetObject("folder_link", resourceCulture); 165 | return ((System.Drawing.Bitmap)(obj)); 166 | } 167 | } 168 | 169 | /// 170 | /// Cerca una risorsa localizzata di tipo System.Drawing.Bitmap. 171 | /// 172 | internal static System.Drawing.Bitmap folder_page { 173 | get { 174 | object obj = ResourceManager.GetObject("folder_page", resourceCulture); 175 | return ((System.Drawing.Bitmap)(obj)); 176 | } 177 | } 178 | 179 | /// 180 | /// Cerca una stringa localizzata simile a Path Not Found. 181 | /// 182 | internal static string MESSAGE_PATH_NOT_FOUND { 183 | get { 184 | return ResourceManager.GetString("MESSAGE_PATH_NOT_FOUND", resourceCulture); 185 | } 186 | } 187 | 188 | /// 189 | /// Cerca una stringa localizzata simile a Document contains unsaved Changes. Do you want to save?. 190 | /// 191 | internal static string MESSAGE_PROMPT_SAVE { 192 | get { 193 | return ResourceManager.GetString("MESSAGE_PROMPT_SAVE", resourceCulture); 194 | } 195 | } 196 | 197 | /// 198 | /// Cerca una stringa localizzata simile a The Path was not found or Access is Denied. 199 | /// 200 | internal static string MESSAGE_TITLE_PATH_NOT_FOUND { 201 | get { 202 | return ResourceManager.GetString("MESSAGE_TITLE_PATH_NOT_FOUND", resourceCulture); 203 | } 204 | } 205 | 206 | /// 207 | /// Cerca una stringa localizzata simile a Confirm Save. 208 | /// 209 | internal static string MESSAGE_TITLE_SAVE { 210 | get { 211 | return ResourceManager.GetString("MESSAGE_TITLE_SAVE", resourceCulture); 212 | } 213 | } 214 | 215 | /// 216 | /// Cerca una stringa localizzata simile a Licensed Under MIT License. 217 | /// 218 | internal static string MESSAGE_UNABLE_TO_RETRIEVE_LICENSE_FILE { 219 | get { 220 | return ResourceManager.GetString("MESSAGE_UNABLE_TO_RETRIEVE_LICENSE_FILE", resourceCulture); 221 | } 222 | } 223 | 224 | /// 225 | /// Cerca una stringa localizzata simile a Done. 226 | /// 227 | internal static string STATUSMSG_DONE { 228 | get { 229 | return ResourceManager.GetString("STATUSMSG_DONE", resourceCulture); 230 | } 231 | } 232 | 233 | /// 234 | /// Cerca una stringa localizzata simile a Importing Menu Structure.... 235 | /// 236 | internal static string STATUSMSG_IMPORTING_MENUSTRUCTURE { 237 | get { 238 | return ResourceManager.GetString("STATUSMSG_IMPORTING_MENUSTRUCTURE", resourceCulture); 239 | } 240 | } 241 | 242 | /// 243 | /// Cerca una stringa localizzata simile a Maximized. 244 | /// 245 | internal static string WINDOWMODE_MAXIMIZED { 246 | get { 247 | return ResourceManager.GetString("WINDOWMODE_MAXIMIZED", resourceCulture); 248 | } 249 | } 250 | 251 | /// 252 | /// Cerca una stringa localizzata simile a Minimized. 253 | /// 254 | internal static string WINDOWMODE_MINIMIZED { 255 | get { 256 | return ResourceManager.GetString("WINDOWMODE_MINIMIZED", resourceCulture); 257 | } 258 | } 259 | 260 | /// 261 | /// Cerca una stringa localizzata simile a Normal. 262 | /// 263 | internal static string WINDOWMODE_NORMAL { 264 | get { 265 | return ResourceManager.GetString("WINDOWMODE_NORMAL", resourceCulture); 266 | } 267 | } 268 | } 269 | } 270 | -------------------------------------------------------------------------------- /ComposerAdmin/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 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 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | About {0} 122 | 123 | 124 | Version {0} 125 | 126 | 127 | 128 | ..\Resources\app_icon_256.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 129 | 130 | 131 | Desktop Composition Files |*.dcxml|All files (*.*)|*.* 132 | 133 | 134 | ..\Resources\computer_go.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 135 | 136 | 137 | ..\Resources\computer_link.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 138 | 139 | 140 | ..\Resources\disk.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 141 | 142 | 143 | ..\Resources\drive_disk.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 144 | 145 | 146 | New Composition File 147 | 148 | 149 | ..\Resources\folder_link.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 150 | 151 | 152 | ..\Resources\folder_page.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 153 | 154 | 155 | Path Not Found 156 | 157 | 158 | Document contains unsaved Changes. Do you want to save? 159 | 160 | 161 | The Path was not found or Access is Denied 162 | 163 | 164 | Confirm Save 165 | 166 | 167 | Licensed Under MIT License 168 | 169 | 170 | Done 171 | 172 | 173 | Importing Menu Structure... 174 | 175 | 176 | Maximized 177 | 178 | 179 | Minimized 180 | 181 | 182 | Normal 183 | 184 | 185 | ..\Resources\new.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 186 | 187 | -------------------------------------------------------------------------------- /ComposerAdmin/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Il codice è stato generato da uno strumento. 4 | // Versione runtime:4.0.30319.42000 5 | // 6 | // Le modifiche apportate a questo file possono provocare un comportamento non corretto e andranno perse se 7 | // il codice viene rigenerato. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ComposerAdmin.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.5.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ComposerAdmin/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ComposerAdmin/Resources/AppIcon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rbicelli/DesktopComposer/081c4f98fca384465eb82215a85fb369dfb1b66c/ComposerAdmin/Resources/AppIcon.ico -------------------------------------------------------------------------------- /ComposerAdmin/Resources/ApplicationLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rbicelli/DesktopComposer/081c4f98fca384465eb82215a85fb369dfb1b66c/ComposerAdmin/Resources/ApplicationLogo.png -------------------------------------------------------------------------------- /ComposerAdmin/Resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rbicelli/DesktopComposer/081c4f98fca384465eb82215a85fb369dfb1b66c/ComposerAdmin/Resources/app_icon.ico -------------------------------------------------------------------------------- /ComposerAdmin/Resources/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rbicelli/DesktopComposer/081c4f98fca384465eb82215a85fb369dfb1b66c/ComposerAdmin/Resources/app_icon_256.png -------------------------------------------------------------------------------- /ComposerAdmin/Resources/computer_go.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rbicelli/DesktopComposer/081c4f98fca384465eb82215a85fb369dfb1b66c/ComposerAdmin/Resources/computer_go.png -------------------------------------------------------------------------------- /ComposerAdmin/Resources/computer_link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rbicelli/DesktopComposer/081c4f98fca384465eb82215a85fb369dfb1b66c/ComposerAdmin/Resources/computer_link.png -------------------------------------------------------------------------------- /ComposerAdmin/Resources/disk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rbicelli/DesktopComposer/081c4f98fca384465eb82215a85fb369dfb1b66c/ComposerAdmin/Resources/disk.png -------------------------------------------------------------------------------- /ComposerAdmin/Resources/drive_disk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rbicelli/DesktopComposer/081c4f98fca384465eb82215a85fb369dfb1b66c/ComposerAdmin/Resources/drive_disk.png -------------------------------------------------------------------------------- /ComposerAdmin/Resources/folder_link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rbicelli/DesktopComposer/081c4f98fca384465eb82215a85fb369dfb1b66c/ComposerAdmin/Resources/folder_link.png -------------------------------------------------------------------------------- /ComposerAdmin/Resources/folder_page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rbicelli/DesktopComposer/081c4f98fca384465eb82215a85fb369dfb1b66c/ComposerAdmin/Resources/folder_page.png -------------------------------------------------------------------------------- /ComposerAdmin/Resources/new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rbicelli/DesktopComposer/081c4f98fca384465eb82215a85fb369dfb1b66c/ComposerAdmin/Resources/new.png -------------------------------------------------------------------------------- /ComposerAdmin/Tools/ADMX/SequenceDesktopComposer.admx: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /ComposerAdmin/Tools/ADMX/SequenceSoftware.admx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /ComposerAdmin/Tools/ADMX/en-US/SequenceDesktopComposer.adml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Sequence Software 9 | Composer Agent 10 | 11 | Enable Composition Agent 12 | This policy settings allows you to manage the Desktop Composer Agent. 13 | If you enable this setting the automatic execution of Composer Agent at User Logon will be enabled. 14 | 15 | Note: In order for this policy to work you still have set the Logon Scripts in User Configuration/Windows/Settings/Script (Logon/Logoff), 16 | It is sufficient to enter the Full Path of the executable file both in Logon/Logoff (Default is %PROGRAMFILES%\Sequence Software\Composer Agent\ComposerAgent.exe), with these arguments: 17 | - For Logon: -compose 18 | - For Logoff: -decompose 19 | 20 | Composition File Location 21 | Specify the Composition File (*.dcxml) location. 22 | UNC Path and envionment variables are allowed. 23 | File must be readable by the user. 24 | 25 | Log File Location 26 | Specify the Composition Log File location. 27 | UNC Path and envionment variables are allowed. 28 | File must be writable by the user and container directory must exists. 29 | 30 | Log Threshold 31 | Specify the Log Threshold. 32 | Events with severity below threshold will not be recorded to log file. 33 | Debug 34 | Information 35 | Warning 36 | Error 37 | Critical 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | Threshold 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /ComposerAdmin/Tools/ADMX/en-US/SequenceSoftware.adml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Sequence Software 9 | 10 | 11 | -------------------------------------------------------------------------------- /ComposerAdmin/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /ComposerAdmin/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ComposerAgent/AgentInstaller.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using System.Diagnostics; 4 | using System.DirectoryServices; 5 | using System.IO; 6 | using System.Security.AccessControl; 7 | using System.Security.Principal; 8 | using System.Threading.Tasks; 9 | 10 | namespace ComposerAgent 11 | { 12 | class AgentInstaller 13 | { 14 | 15 | /// 16 | /// Installation Process 17 | /// - Creates Local User Group 18 | /// - Sets Deny ACL on Common Start Menu for Local User Group Created 19 | /// Run Elevated if started as normal user 20 | /// 21 | public bool Install() 22 | { 23 | Console.WriteLine("Installing..."); 24 | WindowsPrincipal pricipal = new WindowsPrincipal(WindowsIdentity.GetCurrent()); 25 | bool hasAdministrativeRight = pricipal.IsInRole(WindowsBuiltInRole.Administrator); 26 | bool ret = true; 27 | if (!hasAdministrativeRight) 28 | { 29 | Console.WriteLine("Running Installer in Elevated Mode..."); 30 | 31 | ret = RunElevated(System.Reflection.Assembly.GetExecutingAssembly().CodeBase, "-install"); 32 | if (ret) Console.WriteLine("Installation OK"); else Console.WriteLine("Installation ERROR"); 33 | return ret; 34 | } 35 | else 36 | { 37 | //Create Active Directory Group 38 | try 39 | { 40 | Console.Write("Adding Security Group {0} ...", Constants.LOCAL_SECURITYGROUP_NAME); 41 | var ad = new DirectoryEntry("WinNT://" + Environment.MachineName + ",computer"); 42 | DirectoryEntry newGroup = ad.Children.Add(Constants.LOCAL_SECURITYGROUP_NAME, "group"); 43 | newGroup.Invoke("Put", new object[] { "Description", Constants.LOCAL_SECURITYGROUP_DESC }); 44 | newGroup.CommitChanges(); 45 | Console.WriteLine(" [OK]"); 46 | 47 | Console.Write("Setting Security ACLs to target directories..."); 48 | ret = AddDirectorySecurity(System.Environment.GetFolderPath(Environment.SpecialFolder.CommonStartMenu), Constants.LOCAL_SECURITYGROUP_NAME); 49 | ret = AddDirectorySecurity(System.Environment.GetFolderPath(Environment.SpecialFolder.CommonDesktopDirectory), Constants.LOCAL_SECURITYGROUP_NAME); 50 | Console.WriteLine(" [OK]"); 51 | return ret; 52 | } 53 | catch 54 | { 55 | Console.WriteLine(" [ERROR]"); 56 | return false; 57 | } 58 | } 59 | } 60 | 61 | /// 62 | /// Uninstallation Process 63 | /// Rollbacks Installation Process 64 | /// Run Elevated if started as normal user 65 | /// 66 | public bool Uninstall() 67 | { 68 | WindowsPrincipal pricipal = new WindowsPrincipal(WindowsIdentity.GetCurrent()); 69 | bool hasAdministrativeRight = pricipal.IsInRole(WindowsBuiltInRole.Administrator); 70 | bool ret = true; 71 | 72 | if (!hasAdministrativeRight) 73 | { 74 | Console.WriteLine("Running Installer in Elevated Mode..."); 75 | ret = RunElevated(System.Reflection.Assembly.GetExecutingAssembly().CodeBase, "-uninstall"); 76 | if (ret) Console.WriteLine("Uninstallation OK"); else Console.WriteLine("Uninstallation ERROR"); 77 | return ret; 78 | } 79 | else 80 | { 81 | //Delete Local Group 82 | try 83 | { 84 | Console.Write("Setting Security ACLs to target directories..."); 85 | 86 | RemoveDirectorySecurity(System.Environment.GetFolderPath(Environment.SpecialFolder.CommonStartMenu), Constants.LOCAL_SECURITYGROUP_NAME); 87 | AddDirectorySecurity(System.Environment.GetFolderPath(Environment.SpecialFolder.CommonDesktopDirectory), Constants.LOCAL_SECURITYGROUP_NAME); 88 | 89 | Console.WriteLine(" [OK]"); 90 | 91 | Console.Write("Removing Security Group {0} ...", Constants.LOCAL_SECURITYGROUP_NAME); 92 | var ad = new DirectoryEntry("WinNT://" + Environment.MachineName + ",computer"); 93 | var group = ad.Children.Find(Constants.LOCAL_SECURITYGROUP_NAME, "group"); 94 | ad.Children.Remove(group); 95 | Console.WriteLine(" [OK]"); 96 | return true; 97 | } 98 | catch 99 | { 100 | Console.WriteLine(" [ERROR]"); 101 | return false; 102 | } 103 | } 104 | } 105 | 106 | 107 | private static bool RunElevated(string fileName, string args) 108 | { 109 | ProcessStartInfo processInfo = new ProcessStartInfo(); 110 | processInfo.Verb = "runas"; 111 | processInfo.FileName = fileName; 112 | processInfo.Arguments = args; 113 | try 114 | { 115 | using (Process myProcess = Process.Start(processInfo)) { 116 | do 117 | { 118 | //Do Nothing 119 | } while (!myProcess.WaitForExit(250)); 120 | if (myProcess.ExitCode == 0) return true; 121 | } 122 | return false; 123 | } 124 | 125 | catch (Win32Exception) 126 | { 127 | //Do nothing. Probably the user canceled the UAC window 128 | return false; 129 | } 130 | } 131 | 132 | // Adds an ACL entry on the specified directory for the specified account. 133 | public static bool AddDirectorySecurity(string FileName, string Account) 134 | { 135 | // Create a new DirectoryInfo object. 136 | DirectoryInfo dInfo = new DirectoryInfo(FileName); 137 | FileSystemRights Rights = FileSystemRights.ReadAndExecute; 138 | AccessControlType ControlType = AccessControlType.Deny; 139 | 140 | try 141 | { 142 | // Get a DirectorySecurity object that represents the 143 | // current security settings. 144 | DirectorySecurity dSecurity = dInfo.GetAccessControl(); 145 | 146 | // Add the FileSystemAccessRule to the security settings. 147 | dSecurity.AddAccessRule(new FileSystemAccessRule(Account, Rights, ControlType)); 148 | dSecurity.AddAccessRule(new FileSystemAccessRule(Account, Rights, InheritanceFlags.ContainerInherit, PropagationFlags.InheritOnly, ControlType)); 149 | dSecurity.AddAccessRule(new FileSystemAccessRule(Account, Rights, InheritanceFlags.ObjectInherit, PropagationFlags.InheritOnly, ControlType)); 150 | 151 | // Set the new access settings. 152 | dInfo.SetAccessControl(dSecurity); 153 | return true; 154 | } catch 155 | { 156 | return false; 157 | } 158 | } 159 | 160 | // Removes an ACL entry on the specified directory for the specified account. 161 | public static bool RemoveDirectorySecurity(string FileName, string Account) 162 | { 163 | try 164 | { 165 | // Create a new DirectoryInfo object. 166 | DirectoryInfo dInfo = new DirectoryInfo(FileName); 167 | FileSystemRights Rights = FileSystemRights.ReadAndExecute; 168 | AccessControlType ControlType = AccessControlType.Deny; 169 | 170 | // Get a DirectorySecurity object that represents the 171 | // current security settings. 172 | DirectorySecurity dSecurity = dInfo.GetAccessControl(); 173 | // Add the FileSystemAccessRule to the security settings. 174 | dSecurity.RemoveAccessRule(new FileSystemAccessRule(Account, Rights, ControlType)); 175 | dSecurity.RemoveAccessRule(new FileSystemAccessRule(Account, Rights, InheritanceFlags.ContainerInherit, PropagationFlags.InheritOnly, ControlType)); 176 | dSecurity.RemoveAccessRule(new FileSystemAccessRule(Account, Rights, InheritanceFlags.ObjectInherit, PropagationFlags.InheritOnly, ControlType)); 177 | 178 | // Set the new access settings. 179 | dInfo.SetAccessControl(dSecurity); 180 | return true; 181 | } catch 182 | { 183 | return false; 184 | } 185 | } 186 | } 187 | } 188 | -------------------------------------------------------------------------------- /ComposerAgent/AppLogger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.CodeDom; 3 | using System.IO; 4 | 5 | 6 | namespace ComposerAgent 7 | { 8 | public enum LoggerSeverity 9 | { 10 | Debug, 11 | Info, 12 | Warning, 13 | Error, 14 | Critical 15 | } 16 | public static class AppLogger 17 | { 18 | 19 | public static string FileName { 20 | get; set; 21 | } 22 | 23 | public static LoggerSeverity SeverityThreshold { get; set; } 24 | 25 | public static void WriteLine(string Line, Exception e=null) 26 | { 27 | WriteLine(Line, LoggerSeverity.Debug, e); 28 | } 29 | public static void WriteLine(string Line, LoggerSeverity Severity, Exception e = null) 30 | { 31 | string strSeverity; 32 | if (e != null) Line += " (" + e.Message.Replace("\n"," ") + ")"; 33 | try { 34 | if (Severity >= SeverityThreshold) 35 | { 36 | switch (Severity) 37 | { 38 | case LoggerSeverity.Critical: 39 | strSeverity = "CRITICAL"; 40 | break; 41 | case LoggerSeverity.Error: 42 | strSeverity = "ERROR"; 43 | break; 44 | case LoggerSeverity.Warning: 45 | strSeverity = "WARNING"; 46 | break; 47 | case LoggerSeverity.Info: 48 | strSeverity = "INFORMATION"; 49 | break; 50 | case LoggerSeverity.Debug: 51 | default: 52 | strSeverity = "DEBUG"; 53 | break; 54 | } 55 | using (StreamWriter sw = File.AppendText(FileName)) 56 | { 57 | sw.WriteLine(DateTime.Now.ToString() + ": " + strSeverity + " " + Line); 58 | Console.WriteLine(Line); 59 | } 60 | } 61 | } catch (Exception ex) 62 | { 63 | Console.WriteLine("Unable to write to log file: " + ex.Message); 64 | } 65 | 66 | } 67 | 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /ComposerAgent/ComposerAgent.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Debug 11 | AnyCPU 12 | {6D18BC93-D36A-450E-8C64-F8B21A9926A4} 13 | WinExe 14 | ComposerAgent 15 | ComposerAgent 16 | v4.7.2 17 | 512 18 | true 19 | 20 | 21 | 22 | 23 | 24 | AnyCPU 25 | true 26 | full 27 | false 28 | bin\Debug\ 29 | DEBUG;TRACE 30 | prompt 31 | 4 32 | false 33 | 34 | 35 | AnyCPU 36 | pdbonly 37 | true 38 | bin\Release\ 39 | TRACE 40 | prompt 41 | 4 42 | false 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 | {4f905302-b08e-414c-9e4a-c21d4c0958ef} 72 | DesktopComposer 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | Questo progetto fa riferimento a uno o più pacchetti NuGet che non sono presenti in questo computer. Usare lo strumento di ripristino dei pacchetti NuGet per scaricarli. Per altre informazioni, vedere http://go.microsoft.com/fwlink/?LinkID=322105. Il file mancante è {0}. 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /ComposerAgent/ComposerMap.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.ComponentModel; 5 | using System.Diagnostics.Contracts; 6 | using System.Dynamic; 7 | using System.IO; 8 | using System.Linq; 9 | using System.Runtime.Remoting.Messaging; 10 | using System.Text; 11 | using System.Xml; 12 | using System.Xml.Serialization; 13 | using Microsoft.Win32; 14 | 15 | namespace ComposerAgent 16 | { 17 | #region Elements-Shortcuts 18 | public enum CompositionElementLocations 19 | { 20 | StartMenu, 21 | Desktop 22 | } 23 | public interface ICompositionElement 24 | { 25 | string FilePath { get; } 26 | Guid objectID { get; } 27 | } 28 | 29 | public class CompositionElement : ICompositionElement 30 | { 31 | [XmlAttribute] 32 | public Guid objectID { get; set; } 33 | 34 | [XmlAttribute] 35 | public string FilePath { get; set; } 36 | 37 | [XmlAttribute] 38 | public CompositionElementLocations Location { get; set; } 39 | } 40 | 41 | public class CompositionElements : ObservableCollection 42 | { 43 | 44 | } 45 | #endregion 46 | 47 | #region Elements-Registry 48 | public interface ICompositionRegElement 49 | { 50 | string UniqueKeyName { get; } 51 | string ValueName { get; } 52 | } 53 | 54 | public class CompositionRegElement : ICompositionRegElement 55 | { 56 | [XmlAttribute] 57 | public string UniqueKeyName { get; set; } 58 | 59 | [XmlAttribute] 60 | public string ValueName { get; set; } 61 | 62 | [XmlAttribute] 63 | public string ValueType { get; set; } 64 | 65 | [XmlAttribute] 66 | public string RootKey { get; set; } 67 | 68 | [XmlAttribute] 69 | public string SubKey { get; set; } 70 | 71 | [XmlAttribute] 72 | public string Value { get; set; } 73 | 74 | [XmlIgnore] 75 | public RegistryValueKind ValueKind { 76 | get { 77 | switch (ValueType.ToLower()) 78 | { 79 | case "qword": 80 | //Integer 81 | return RegistryValueKind.QWord; 82 | 83 | case "dword": 84 | return RegistryValueKind.DWord; 85 | 86 | case "string": 87 | default: 88 | return RegistryValueKind.String; 89 | } 90 | } 91 | } 92 | 93 | [XmlIgnore] 94 | public RegistryHive Hive { 95 | get { 96 | switch (RootKey.ToUpper()) 97 | { 98 | case "HKEY_LOCAL_MACHINE": 99 | return RegistryHive.LocalMachine; 100 | 101 | case "HKEY_CURRENT_USER": 102 | default: 103 | return RegistryHive.CurrentUser; 104 | } 105 | } 106 | } 107 | 108 | 109 | private object ParsedValue(string ParamValue) 110 | { 111 | long lngValue = 0; 112 | long.TryParse(ParamValue, out lngValue); 113 | 114 | switch (ValueType.ToLower()) 115 | { 116 | case "qword": 117 | //Integer 118 | return (int)lngValue; 119 | 120 | case "dword": 121 | return lngValue; 122 | 123 | case "string": 124 | default: 125 | return ParamValue; 126 | } 127 | } 128 | 129 | public bool SaveToRegistry() 130 | { 131 | string registrykey = RootKey + '\\' + SubKey; 132 | object regValue; 133 | 134 | if (Value.ToLower() == "[delete]") { 135 | try 136 | { 137 | RegistryKey rKey; 138 | rKey = RegistryKey.OpenBaseKey(Hive, RegistryView.Default); 139 | rKey = rKey.OpenSubKey(SubKey, true); 140 | if (rKey!=null) rKey.DeleteValue(ValueName); 141 | } catch (Exception e) 142 | { 143 | AppLogger.WriteLine("Error: ", e); 144 | } 145 | } 146 | else 147 | { 148 | //Set Value 149 | try 150 | { 151 | regValue = ParsedValue(Value); 152 | Registry.SetValue(registrykey, ValueName, regValue, ValueKind); 153 | } catch (Exception e) 154 | { 155 | AppLogger.WriteLine("Error: ", e); 156 | } 157 | } 158 | return true; 159 | } 160 | 161 | } 162 | 163 | public class CompositionRegElements : ObservableCollection 164 | { 165 | 166 | } 167 | #endregion 168 | 169 | public class ComposerMap 170 | { 171 | private CompositionElements _ComposedElements; 172 | private CompositionRegElements _ComposedRegElements; 173 | public CompositionElements ComposedElements { 174 | get => _ComposedElements; 175 | } 176 | 177 | public CompositionRegElements ComposedRegElements 178 | { 179 | get => _ComposedRegElements; 180 | } 181 | 182 | [XmlAttribute] 183 | public int ComposedStatus { get; set; } 184 | 185 | public ComposerMap() 186 | { 187 | _ComposedElements = new CompositionElements(); 188 | _ComposedRegElements = new CompositionRegElements(); 189 | } 190 | 191 | public void AddItem(Guid ItemGuid, string ItemPath, CompositionElementLocations ItemLocation) 192 | { 193 | CompositionElement e = new CompositionElement() 194 | { 195 | objectID = ItemGuid, 196 | FilePath = ItemPath, 197 | Location = ItemLocation 198 | }; 199 | _ComposedElements.Add(e); 200 | } 201 | 202 | public void AddRegItem(string uniqueKeyName, string valueType, string rootKey, string subKey, string valueName, string value) 203 | { 204 | CompositionRegElement e = new CompositionRegElement() { 205 | UniqueKeyName = uniqueKeyName, 206 | RootKey = rootKey, 207 | ValueName = valueName, 208 | SubKey = subKey, 209 | Value = value, 210 | ValueType = valueType 211 | }; 212 | _ComposedRegElements.Add(e); 213 | } 214 | 215 | #region Serialization 216 | public void Serialize(string Filename) 217 | { 218 | XmlSerializer xsSubmit = new XmlSerializer(typeof(ComposerMap)); 219 | var subReq = this; 220 | 221 | using (var sww = new StreamWriter(Filename)) 222 | { 223 | using (XmlWriter writer = XmlWriter.Create(sww)) 224 | { 225 | xsSubmit.Serialize(writer, subReq); 226 | } 227 | } 228 | } 229 | 230 | public bool Deserialize(string Filename) 231 | { 232 | XmlSerializer serializer = new XmlSerializer(typeof(ComposerMap)); 233 | ComposerMap subReq = this; 234 | 235 | try 236 | { 237 | using (Stream reader = new FileStream(Filename, FileMode.Open)) 238 | { 239 | // Call the Deserialize method to restore the object's state. 240 | subReq = (ComposerMap)serializer.Deserialize(reader); 241 | _ComposedElements = subReq.ComposedElements; 242 | _ComposedRegElements = subReq.ComposedRegElements; 243 | this.ComposedStatus = subReq.ComposedStatus; 244 | } 245 | 246 | return true; 247 | } 248 | catch (Exception e) 249 | { 250 | Console.WriteLine(e.Message); 251 | return false; 252 | } 253 | } 254 | #endregion 255 | 256 | } 257 | } 258 | -------------------------------------------------------------------------------- /ComposerAgent/ConsoleHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.InteropServices; 5 | using System.Text; 6 | 7 | namespace ComposerAgent 8 | { 9 | public static class ConsoleHandler 10 | { 11 | 12 | // http://msdn.microsoft.com/en-us/library/ms681944(VS.85).aspx 13 | /// 14 | /// Allocates a new console for the calling process. 15 | /// 16 | /// nonzero if the function succeeds; otherwise, zero. 17 | /// 18 | /// A process can be associated with only one console, 19 | /// so the function fails if the calling process already has a console. 20 | /// 21 | [DllImport("kernel32.dll", SetLastError = true)] 22 | internal static extern int AllocConsole(); 23 | 24 | // http://msdn.microsoft.com/en-us/library/ms683150(VS.85).aspx 25 | /// 26 | /// Detaches the calling process from its console. 27 | /// 28 | /// nonzero if the function succeeds; otherwise, zero. 29 | /// 30 | /// If the calling process is not already attached to a console, 31 | /// the error code returned is ERROR_INVALID_PARAMETER (87). 32 | /// 33 | [DllImport("kernel32.dll", SetLastError = true)] 34 | internal static extern int FreeConsole(); 35 | 36 | /// 37 | /// Check if Program is launched from a console 38 | /// 39 | /// 40 | [DllImport("kernel32.dll")] 41 | static extern IntPtr GetConsoleWindow(); 42 | 43 | /// 44 | /// Attach Console 45 | /// 46 | /// 47 | /// 48 | [DllImport("kernel32.dll")] 49 | static extern bool AttachConsole(int dwProcessId); 50 | private const int ATTACH_PARENT_PROCESS = -1; 51 | 52 | public static bool IsConsolePresent() 53 | { 54 | if (GetConsoleWindow() != IntPtr.Zero) 55 | return false; 56 | else 57 | return true; 58 | } 59 | 60 | public static void AllocateConsole(bool AllocateOnlyIfConsoleExists = true) 61 | { 62 | bool bAllocate = true; 63 | 64 | if ((AllocateOnlyIfConsoleExists)) 65 | bAllocate = IsConsolePresent(); 66 | 67 | if (bAllocate) AttachConsole(ATTACH_PARENT_PROCESS); 68 | } 69 | 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /ComposerAgent/Constants.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace ComposerAgent 7 | { 8 | public static class Constants 9 | { 10 | public const string LOCAL_SECURITYGROUP_NAME = "DesktopComposer Users"; 11 | public const string LOCAL_SECURITYGROUP_DESC = "Security group added for DesktopComposer Functionalities"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ComposerAgent/InputArguments.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace ComposerAgent 5 | { 6 | public class InputArguments 7 | { 8 | #region fields & properties 9 | public const string DEFAULT_KEY_LEADING_PATTERN = "-"; 10 | 11 | protected Dictionary _parsedArguments = new Dictionary(StringComparer.OrdinalIgnoreCase); 12 | protected readonly string _keyLeadingPattern; 13 | 14 | public string this[string key] 15 | { 16 | get { return GetValue(key); } 17 | set 18 | { 19 | if (key != null) 20 | _parsedArguments[key] = value; 21 | } 22 | } 23 | public string KeyLeadingPattern 24 | { 25 | get { return _keyLeadingPattern; } 26 | } 27 | #endregion 28 | 29 | #region public methods 30 | public InputArguments(string[] args, string keyLeadingPattern) 31 | { 32 | _keyLeadingPattern = !string.IsNullOrEmpty(keyLeadingPattern) ? keyLeadingPattern : DEFAULT_KEY_LEADING_PATTERN; 33 | 34 | if (args != null && args.Length > 0) 35 | Parse(args); 36 | } 37 | public InputArguments(string[] args) : this(args, null) 38 | { 39 | } 40 | 41 | public bool Contains(string key) 42 | { 43 | string adjustedKey; 44 | return ContainsKey(key, out adjustedKey); 45 | } 46 | 47 | public virtual string GetPeeledKey(string key) 48 | { 49 | return IsKey(key) ? key.Substring(_keyLeadingPattern.Length) : key; 50 | } 51 | public virtual string GetDecoratedKey(string key) 52 | { 53 | return !IsKey(key) ? (_keyLeadingPattern + key) : key; 54 | } 55 | public virtual bool IsKey(string str) 56 | { 57 | return str.StartsWith(_keyLeadingPattern); 58 | } 59 | #endregion 60 | 61 | #region internal methods 62 | protected virtual void Parse(string[] args) 63 | { 64 | for (int i = 0; i < args.Length; i++) 65 | { 66 | if (args[i] == null) continue; 67 | 68 | string key = null; 69 | string val = null; 70 | 71 | if (IsKey(args[i])) 72 | { 73 | key = args[i]; 74 | 75 | if (i + 1 < args.Length && !IsKey(args[i + 1])) 76 | { 77 | val = args[i + 1]; 78 | i++; 79 | } 80 | } 81 | else 82 | val = args[i]; 83 | 84 | // adjustment 85 | if (key == null) 86 | { 87 | key = val; 88 | val = null; 89 | } 90 | _parsedArguments[key] = val; 91 | } 92 | } 93 | 94 | protected virtual string GetValue(string key) 95 | { 96 | string adjustedKey; 97 | if (ContainsKey(key, out adjustedKey)) 98 | return _parsedArguments[adjustedKey]; 99 | 100 | return null; 101 | } 102 | 103 | protected virtual bool ContainsKey(string key, out string adjustedKey) 104 | { 105 | adjustedKey = key; 106 | 107 | if (_parsedArguments.ContainsKey(key)) 108 | return true; 109 | 110 | if (IsKey(key)) 111 | { 112 | string peeledKey = GetPeeledKey(key); 113 | if (_parsedArguments.ContainsKey(peeledKey)) 114 | { 115 | adjustedKey = peeledKey; 116 | return true; 117 | } 118 | return false; 119 | } 120 | 121 | string decoratedKey = GetDecoratedKey(key); 122 | if (_parsedArguments.ContainsKey(decoratedKey)) 123 | { 124 | adjustedKey = decoratedKey; 125 | return true; 126 | } 127 | return false; 128 | } 129 | #endregion 130 | } 131 | } -------------------------------------------------------------------------------- /ComposerAgent/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Runtime.InteropServices; 4 | 5 | namespace ComposerAgent 6 | { 7 | class Program 8 | { 9 | private static int _exitCode = 1; 10 | private static bool _noconsole = false; 11 | static void Main(string[] args) 12 | { 13 | 14 | UtilityArguments arguments = new UtilityArguments(args); 15 | 16 | _noconsole = (arguments.NoConsole); 17 | 18 | if (_noconsole == false) ConsoleHandler.AllocateConsole(); 19 | 20 | if (arguments.Compose) 21 | { 22 | if (File.Exists(arguments.Filename) | (arguments.Filename==null)) 23 | { 24 | string desktopPath = arguments.DesktopPath; 25 | string startPath = arguments.StartMenuPath; 26 | Compose(arguments.Filename, startPath, desktopPath); 27 | AppExit(); 28 | } 29 | } 30 | 31 | if (arguments.Decompose) 32 | { 33 | if (File.Exists(arguments.Filename) | (arguments.Filename == null)) 34 | { 35 | string desktopPath = arguments.DesktopPath; 36 | string startPath = arguments.StartMenuPath; 37 | Decompose(arguments.Filename, startPath, desktopPath); 38 | AppExit(); 39 | } 40 | } 41 | 42 | if (arguments.Install) 43 | { 44 | Install(); 45 | AppExit(); 46 | } 47 | 48 | if (arguments.Uninstall) 49 | { 50 | Uninstall(); 51 | AppExit(); 52 | } 53 | } 54 | 55 | private static void AppExit() 56 | { 57 | if (_noconsole==false) ConsoleHandler.FreeConsole(); 58 | Environment.Exit(_exitCode); 59 | } 60 | 61 | private static void Compose(string FileName, string StartMenuPath, string DesktopPath) 62 | { 63 | Composer _lcomposer = new Composer(FileName, StartMenuPath, DesktopPath); 64 | if (_lcomposer.Compose()) _exitCode = 0; 65 | } 66 | 67 | private static void Decompose(string FileName, string StartMenuPath, string DesktopPath) 68 | { 69 | Composer _lcomposer = new Composer(FileName, StartMenuPath, DesktopPath); 70 | if (_lcomposer.Decompose()) _exitCode = 0; 71 | } 72 | 73 | private static void Install() { 74 | AgentInstaller i = new AgentInstaller(); 75 | if (i.Install()) _exitCode = 0; 76 | } 77 | 78 | private static void Uninstall() { 79 | AgentInstaller i = new AgentInstaller(); 80 | if (i.Uninstall()) _exitCode = 0; 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /ComposerAgent/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // Le informazioni generali relative a un assembly sono controllate dal seguente 6 | // set di attributi. Modificare i valori di questi attributi per modificare le informazioni 7 | // associate a un assembly. 8 | [assembly: AssemblyTitle("ComposerAgent")] 9 | [assembly: AssemblyDescription("Desktop Composition Agent")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Sequence Software")] 12 | [assembly: AssemblyProduct("Composer Agent")] 13 | [assembly: AssemblyCopyright("Copyright © 2020 Riccardo Bicelli")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Se si imposta ComVisible su false, i tipi in questo assembly non saranno visibili 18 | // ai componenti COM. Se è necessario accedere a un tipo in questo assembly da 19 | // COM, impostare su true l'attributo ComVisible per tale tipo. 20 | [assembly: ComVisible(false)] 21 | 22 | // Se il progetto viene esposto a COM, il GUID seguente verrà utilizzato come ID della libreria dei tipi 23 | [assembly: Guid("6d18bc93-d36a-450e-8c64-f8b21a9926a4")] 24 | 25 | // Le informazioni sulla versione di un assembly sono costituite dai seguenti quattro valori: 26 | // 27 | // Versione principale 28 | // Versione secondaria 29 | // Numero di build 30 | // Revisione 31 | // 32 | // È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build 33 | // usando l'asterisco '*' come illustrato di seguito: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("0.9.2.1")] 36 | [assembly: AssemblyFileVersion("0.9.2.1")] 37 | -------------------------------------------------------------------------------- /ComposerAgent/UtilityArguments.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace ComposerAgent 7 | { 8 | public class UtilityArguments : InputArguments 9 | { 10 | public bool Install 11 | { 12 | get { return KeyPresent("install"); } 13 | } 14 | 15 | public bool Uninstall 16 | { 17 | get { return KeyPresent("uninstall"); } 18 | } 19 | 20 | public bool Compose 21 | { 22 | get { return KeyPresent("compose"); } 23 | } 24 | 25 | public bool Decompose 26 | { 27 | get { return KeyPresent("decompose"); } 28 | } 29 | 30 | public bool NoConsole 31 | { 32 | get { return KeyPresent("noconsole"); } 33 | } 34 | 35 | public string Filename 36 | { 37 | get { return GetValue("file"); } 38 | } 39 | 40 | public string DesktopPath 41 | { 42 | get { return GetValue("desktopdir"); } 43 | } 44 | 45 | public string StartMenuPath 46 | { 47 | get { return GetValue("startdir"); } 48 | } 49 | 50 | public UtilityArguments(string[] args) : base(args) 51 | { 52 | } 53 | 54 | protected bool GetBoolValue(string key) 55 | { 56 | string adjustedKey; 57 | if (ContainsKey(key, out adjustedKey)) 58 | { 59 | bool res; 60 | bool.TryParse(_parsedArguments[adjustedKey], out res); 61 | return res; 62 | } 63 | return false; 64 | } 65 | 66 | protected bool KeyPresent(string key) 67 | { 68 | string adjustedKey; 69 | if (ContainsKey(key, out adjustedKey)) 70 | { 71 | return true; 72 | } 73 | else 74 | { 75 | return false; 76 | } 77 | } 78 | 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /ComposerAgent/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /ComposerAgent/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DesktopComposer.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29911.84 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComposerAdmin", "ComposerAdmin\ComposerAdmin.csproj", "{D4CDC189-4E58-4C38-91DA-650A4282F0B6}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DesktopComposer", "DesktopComposer\DesktopComposer.csproj", "{4F905302-B08E-414C-9E4A-C21D4C0958EF}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComposerAgent", "ComposerAgent\ComposerAgent.csproj", "{6D18BC93-D36A-450E-8C64-F8B21A9926A4}" 11 | EndProject 12 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{7C419D55-B0B6-49EB-B242-F241B98356EF}" 13 | ProjectSection(SolutionItems) = preProject 14 | .editorconfig = .editorconfig 15 | CREDITS.txt = CREDITS.txt 16 | LICENSE = LICENSE 17 | README.md = README.md 18 | EndProjectSection 19 | EndProject 20 | Global 21 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 22 | Debug|Any CPU = Debug|Any CPU 23 | Release|Any CPU = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 26 | {D4CDC189-4E58-4C38-91DA-650A4282F0B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {D4CDC189-4E58-4C38-91DA-650A4282F0B6}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {D4CDC189-4E58-4C38-91DA-650A4282F0B6}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {D4CDC189-4E58-4C38-91DA-650A4282F0B6}.Release|Any CPU.Build.0 = Release|Any CPU 30 | {4F905302-B08E-414C-9E4A-C21D4C0958EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 31 | {4F905302-B08E-414C-9E4A-C21D4C0958EF}.Debug|Any CPU.Build.0 = Debug|Any CPU 32 | {4F905302-B08E-414C-9E4A-C21D4C0958EF}.Release|Any CPU.ActiveCfg = Release|Any CPU 33 | {4F905302-B08E-414C-9E4A-C21D4C0958EF}.Release|Any CPU.Build.0 = Release|Any CPU 34 | {6D18BC93-D36A-450E-8C64-F8B21A9926A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 35 | {6D18BC93-D36A-450E-8C64-F8B21A9926A4}.Debug|Any CPU.Build.0 = Debug|Any CPU 36 | {6D18BC93-D36A-450E-8C64-F8B21A9926A4}.Release|Any CPU.ActiveCfg = Release|Any CPU 37 | {6D18BC93-D36A-450E-8C64-F8B21A9926A4}.Release|Any CPU.Build.0 = Release|Any CPU 38 | EndGlobalSection 39 | GlobalSection(SolutionProperties) = preSolution 40 | HideSolutionNode = FALSE 41 | EndGlobalSection 42 | GlobalSection(ExtensibilityGlobals) = postSolution 43 | SolutionGuid = {10CCB5EE-F013-4957-8E58-B846C08AFB41} 44 | EndGlobalSection 45 | EndGlobal 46 | -------------------------------------------------------------------------------- /DesktopComposer/AppLogger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | 5 | namespace DesktopComposer 6 | { 7 | public enum LoggerSeverity 8 | { 9 | Debug, 10 | Info, 11 | Warning, 12 | Error, 13 | Critical 14 | } 15 | public static class AppLogger 16 | { 17 | 18 | public static string FileName { 19 | get; set; 20 | } 21 | 22 | public static LoggerSeverity SeverityThreshold { get; set; } 23 | 24 | public static void WriteLine(string Line, Exception e=null) 25 | { 26 | WriteLine(Line, LoggerSeverity.Debug, e); 27 | } 28 | public static void WriteLine(string Line, LoggerSeverity Severity, Exception e = null) 29 | { 30 | string strSeverity; 31 | if (e != null) Line += " (" + e.Message.Replace("\n"," ") + ")"; 32 | try { 33 | if (Severity >= SeverityThreshold) 34 | { 35 | switch (Severity) 36 | { 37 | case LoggerSeverity.Critical: 38 | strSeverity = "CRITICAL"; 39 | break; 40 | case LoggerSeverity.Error: 41 | strSeverity = "ERROR"; 42 | break; 43 | case LoggerSeverity.Warning: 44 | strSeverity = "WARNING"; 45 | break; 46 | case LoggerSeverity.Info: 47 | strSeverity = "INFORMATION"; 48 | break; 49 | case LoggerSeverity.Debug: 50 | default: 51 | strSeverity = "DEBUG"; 52 | break; 53 | } 54 | using (StreamWriter sw = File.AppendText(FileName)) 55 | { 56 | sw.WriteLine(DateTime.Now.ToString() + ": " + strSeverity + " " + Line); 57 | Console.WriteLine(Line); 58 | } 59 | } 60 | } catch (Exception ex) 61 | { 62 | Console.WriteLine("Unable to write to log file: " + ex.Message); 63 | } 64 | 65 | } 66 | 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /DesktopComposer/DesktopComposer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Debug 11 | AnyCPU 12 | {4F905302-B08E-414C-9E4A-C21D4C0958EF} 13 | Library 14 | Properties 15 | DesktopComposer 16 | DesktopComposer 17 | v4.7.2 18 | 512 19 | true 20 | 21 | 22 | 23 | 24 | 25 | true 26 | full 27 | false 28 | bin\Debug\ 29 | DEBUG;TRACE 30 | prompt 31 | 4 32 | false 33 | 34 | 35 | pdbonly 36 | true 37 | bin\Release\ 38 | TRACE 39 | prompt 40 | 4 41 | false 42 | 43 | 44 | 45 | ..\packages\IconLib.0.74.3\lib\net40\IconLib.dll 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 | {F935DC20-1CF0-11D0-ADB9-00C04FD58A0B} 74 | 1 75 | 0 76 | 0 77 | tlbimp 78 | False 79 | True 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | Questo progetto fa riferimento a uno o più pacchetti NuGet che non sono presenti in questo computer. Usare lo strumento di ripristino dei pacchetti NuGet per scaricarli. Per altre informazioni, vedere http://go.microsoft.com/fwlink/?LinkID=322105. Il file mancante è {0}. 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /DesktopComposer/DirectoryIterator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace DesktopComposer 7 | { 8 | public class DirectoryIterator 9 | { 10 | private List _files; 11 | 12 | public List Files 13 | { 14 | get { return _files; } 15 | } 16 | /// 17 | /// Recursive Iterate Through a Directory and returnd a list of FileInfo Object 18 | /// 19 | /// 20 | /// 21 | /// List of FileInfo Items 22 | public List TraverseTree(string root, string FilefilterExt="") 23 | { 24 | _files = new List(); 25 | 26 | // Data structure to hold names of subfolders to be 27 | // examined for files. 28 | Stack dirs = new Stack(20); 29 | 30 | if (!System.IO.Directory.Exists(root) & (root!="")) 31 | { 32 | throw new ArgumentException(); 33 | } 34 | if (root!="") dirs.Push(root); 35 | 36 | while (dirs.Count > 0) 37 | { 38 | string currentDir = dirs.Pop(); 39 | string[] subDirs; 40 | try 41 | { 42 | subDirs = System.IO.Directory.GetDirectories(currentDir); 43 | } 44 | // An UnauthorizedAccessException exception will be thrown if we do not have 45 | // discovery permission on a folder or file. It may or may not be acceptable 46 | // to ignore the exception and continue enumerating the remaining files and 47 | // folders. It is also possible (but unlikely) that a DirectoryNotFound exception 48 | // will be raised. This will happen if currentDir has been deleted by 49 | // another application or thread after our call to Directory.Exists. The 50 | // choice of which exceptions to catch depends entirely on the specific task 51 | // you are intending to perform and also on how much you know with certainty 52 | // about the systems on which this code will run. 53 | catch (UnauthorizedAccessException e) 54 | { 55 | Console.WriteLine(e.Message); 56 | continue; 57 | } 58 | catch (System.IO.DirectoryNotFoundException e) 59 | { 60 | Console.WriteLine(e.Message); 61 | continue; 62 | } 63 | 64 | string[] files; 65 | try 66 | { 67 | files = System.IO.Directory.GetFiles(currentDir); 68 | } 69 | 70 | catch (UnauthorizedAccessException e) 71 | { 72 | Console.WriteLine(e.Message); 73 | continue; 74 | } 75 | 76 | catch (System.IO.DirectoryNotFoundException e) 77 | { 78 | Console.WriteLine(e.Message); 79 | continue; 80 | } 81 | 82 | catch (Exception e) 83 | { 84 | Console.WriteLine(e.Message); 85 | continue; 86 | } 87 | // Perform the required action on each file here. 88 | // Modify this block to perform your required task. 89 | foreach (string file in files) 90 | { 91 | try 92 | { 93 | // Perform whatever action is required in your scenario. 94 | System.IO.FileInfo fi = new System.IO.FileInfo(file); 95 | if ((FilefilterExt=="") || (fi.Extension == FilefilterExt)) 96 | { 97 | _files.Add(fi); 98 | Console.WriteLine("{0}: {1}, {2}, {3}", fi.Name, fi.Length, fi.CreationTime, fi.Extension); 99 | } 100 | 101 | 102 | } 103 | catch (System.IO.FileNotFoundException e) 104 | { 105 | // If file was deleted by a separate application 106 | // or thread since the call to TraverseTree() 107 | // then just continue. 108 | Console.WriteLine(e.Message); 109 | continue; 110 | } 111 | } 112 | 113 | // Push the subdirectories onto the stack for traversal. 114 | // This could also be done before handing the files. 115 | foreach (string str in subDirs) 116 | dirs.Push(str); 117 | } 118 | return _files; 119 | } 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /DesktopComposer/FileUtils.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace DesktopComposer 5 | { 6 | public static class FileUtils 7 | { 8 | public static bool Exists(string fileName) 9 | { 10 | if (File.Exists(fileName)) return true; 11 | if (ExistsOnPath(fileName)) return true; 12 | return false; 13 | } 14 | public static bool ExistsOnPath(string fileName) 15 | { 16 | return GetFullPath(fileName) != null; 17 | } 18 | 19 | public static string GetFullPath(string fileName) 20 | { 21 | if (File.Exists(fileName)) 22 | return Path.GetFullPath(fileName); 23 | 24 | var values = Environment.GetEnvironmentVariable("PATH"); 25 | foreach (var path in values.Split(Path.PathSeparator)) 26 | { 27 | var fullPath = Path.Combine(path, fileName); 28 | if (File.Exists(fullPath)) 29 | return fullPath; 30 | } 31 | return null; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /DesktopComposer/Implementation/ACL.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Xml.Serialization; 6 | using DesktopComposer.Interfaces; 7 | 8 | namespace DesktopComposer.Implementation 9 | { 10 | public enum ACLType 11 | { 12 | Allow = 0, 13 | Deny = 1 14 | } 15 | 16 | public enum ACLObjectType 17 | { 18 | User = 1, 19 | Group = 2 20 | } 21 | public class ACL : IACL, ICloneable 22 | { 23 | [XmlAttribute] 24 | public Guid ObjectID { get; set; } 25 | 26 | [XmlAttribute] 27 | public String SID { get; set; } 28 | 29 | [XmlAttribute] 30 | public String ObjectName { get; set; } 31 | 32 | [XmlAttribute] 33 | public String ObjectPath { get; set; } //TODO: Consider Deletion 34 | 35 | [XmlAttribute] 36 | public ACLType ACLType { get; set; } 37 | 38 | [XmlAttribute] 39 | public bool Disabled { get; set; } 40 | 41 | [XmlAttribute] 42 | public ACLObjectType ObjectType { get; set; } 43 | 44 | [XmlAttribute] 45 | public string ObjectShortName{ 46 | get { 47 | /* 48 | if (ObjectPath != null) 49 | { 50 | string[] str = ObjectPath.Split('/'); 51 | if (str.Length > 1) 52 | { 53 | //return str[str.Length - 2] + '\\' + str[str.Length - 1]; 54 | return str[str.Length - 2] + '\\' + ObjectName; 55 | } 56 | } 57 | */ 58 | return ObjectName; 59 | } 60 | } 61 | 62 | public object Clone() 63 | { 64 | ACL clonedACL = new ACL { 65 | ObjectID = ObjectID, 66 | SID = SID, 67 | ObjectName = ObjectName, 68 | ObjectPath = ObjectPath, 69 | ACLType = ACLType, 70 | Disabled = Disabled, 71 | ObjectType = ObjectType 72 | }; 73 | 74 | return clonedACL; 75 | } 76 | 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /DesktopComposer/Implementation/ACLs.cs: -------------------------------------------------------------------------------- 1 |  2 | using System; 3 | using System.Collections.ObjectModel; 4 | using System.Linq; 5 | using DesktopComposer.Interfaces; 6 | 7 | namespace DesktopComposer.Implementation 8 | { 9 | public class ACLs : ObservableCollection, ICloneable 10 | { 11 | public ACL this[string sid] 12 | { 13 | get 14 | { 15 | return (from acl in this 16 | where acl.SID == sid 17 | select acl).FirstOrDefault(); 18 | } 19 | 20 | } 21 | 22 | public object Clone() { 23 | ACLs ClonedAcls = new ACLs(); 24 | foreach (ACL acl in this) 25 | { 26 | ClonedAcls.Add((ACL)acl.Clone()); 27 | } 28 | return ClonedAcls; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /DesktopComposer/Implementation/Composition.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Security.AccessControl; 7 | using System.Text; 8 | using System.Xml; 9 | using System.Xml.Serialization; 10 | 11 | namespace DesktopComposer.Implementation 12 | { 13 | public class Composition 14 | { 15 | private Shortcuts _shortcuts; 16 | 17 | public Shortcuts Shortcuts 18 | { 19 | get => _shortcuts; 20 | } 21 | 22 | public Composition() 23 | { 24 | _shortcuts = new Shortcuts(); 25 | } 26 | 27 | public void LoadShortcutsFromPath(string path) 28 | { 29 | List files; 30 | DirectoryIterator di = new DirectoryIterator(); 31 | files = di.TraverseTree(path,".lnk"); 32 | 33 | foreach (System.IO.FileInfo lFile in files) 34 | _shortcuts.Add(lFile.FullName, path); 35 | } 36 | 37 | public void Serialize(string Filename) 38 | { 39 | XmlSerializer xsSubmit = new XmlSerializer(typeof(Composition)); 40 | var subReq = this; 41 | 42 | using (var sww = new StreamWriter(Filename)) 43 | { 44 | using (XmlWriter writer = XmlWriter.Create(sww)) 45 | { 46 | xsSubmit.Serialize(writer, subReq); 47 | } 48 | } 49 | } 50 | 51 | public bool Deserialize(string Filename) 52 | { 53 | XmlSerializer serializer = new XmlSerializer(typeof(Composition)); 54 | Composition subReq = this; 55 | 56 | try { 57 | using (Stream reader = new FileStream(Filename, FileMode.Open)) 58 | { 59 | // Call the Deserialize method to restore the object's state. 60 | subReq = (Composition)serializer.Deserialize(reader); 61 | } 62 | this._shortcuts = subReq.Shortcuts; 63 | return true; 64 | } 65 | catch(Exception e) 66 | { 67 | Console.WriteLine(e.Message); 68 | return false; 69 | } 70 | } 71 | 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /DesktopComposer/Implementation/Shortcut.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | using System.Drawing.IconLib; 6 | using System.IO; 7 | using System.Linq; 8 | using System.Xml.Serialization; 9 | using DesktopComposer.Interfaces; 10 | using IWshRuntimeLibrary; 11 | 12 | namespace DesktopComposer.Implementation 13 | { 14 | public class Shortcut : IShortcut 15 | { 16 | public ACLs ACLs; 17 | 18 | [XmlAttribute] 19 | public Guid ObjectID { get; set; } 20 | 21 | public string MenuPath { get; set; } 22 | 23 | [XmlAttribute] 24 | public bool PutOnDesktop { get; set; } 25 | 26 | [XmlAttribute] 27 | public bool PutOnTaskBar { get; set; } 28 | 29 | [XmlAttribute] 30 | public bool PutOnStartMenu { get; set; } 31 | 32 | [XmlAttribute] 33 | public bool CheckIfTargetExists { get; set; } 34 | 35 | [XmlAttribute] 36 | public string TargetPath { get; set; } 37 | 38 | [XmlAttribute] 39 | public string Arguments { get; set; } 40 | 41 | [XmlAttribute] 42 | public string WorkingDirectory { get; set; } 43 | 44 | [XmlAttribute] 45 | public string DisplayName { get; set; } 46 | 47 | [XmlAttribute] 48 | public string ExtType { get; set; } 49 | 50 | [XmlAttribute] 51 | public string Description { get; set; } 52 | 53 | [XmlAttribute] 54 | public string Comment { get; set; } 55 | 56 | [XmlAttribute] 57 | public string IconLocation { get; set; } 58 | 59 | [XmlIgnore] 60 | public Icon IconCacheSmall { get; set; } 61 | 62 | [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] 63 | [XmlElement("IconCacheSmall")] 64 | public byte[] IconCacheSmallSerialized 65 | { 66 | get 67 | { 68 | // serialize 69 | if (IconCacheSmall == null) return null; 70 | MultiIcon mIcon = new MultiIcon(); 71 | SingleIcon sIcon = mIcon.Add("smallicon"); 72 | sIcon.CreateFrom(IconCacheLarge.ToBitmap(), IconOutputFormat.Vista); 73 | using (MemoryStream ms = new MemoryStream()) 74 | { 75 | sIcon.Save(ms); 76 | return ms.ToArray(); 77 | } 78 | } 79 | set 80 | { 81 | // deserialize 82 | if (value == null) 83 | { 84 | IconCacheSmall = null; 85 | } 86 | else 87 | { 88 | MultiIcon mIcon = new MultiIcon(); 89 | SingleIcon sIcon = mIcon.Add("largeicon"); 90 | using (MemoryStream ms = new MemoryStream(value)) 91 | { 92 | sIcon.Load(ms); 93 | IconCacheSmall = sIcon.Icon; 94 | } 95 | } 96 | } 97 | } 98 | 99 | [XmlIgnore] 100 | public Icon IconCacheLarge { get; set; } 101 | 102 | [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] 103 | [XmlElement("IconCacheLarge")] 104 | public byte[] IconCacheLargeSerialized 105 | { 106 | get 107 | { // serialize 108 | 109 | if (IconCacheLarge == null) return null; 110 | 111 | MultiIcon mIcon = new MultiIcon(); 112 | SingleIcon sIcon = mIcon.Add("largeicon"); 113 | sIcon.CreateFrom(IconCacheLarge.ToBitmap(), IconOutputFormat.Vista); 114 | 115 | using (MemoryStream ms = new MemoryStream()) 116 | { 117 | //IconCacheLarge.Save(ms); 118 | sIcon.Save(ms); 119 | return ms.ToArray(); 120 | } 121 | } 122 | set 123 | { // deserialize 124 | if (value == null) 125 | { 126 | IconCacheLarge = null; 127 | } 128 | else 129 | { 130 | 131 | MultiIcon mIcon = new MultiIcon(); 132 | SingleIcon sIcon = mIcon.Add("largeicon"); 133 | using (MemoryStream ms = new MemoryStream(value)) 134 | { 135 | sIcon.Load(ms); 136 | IconCacheLarge = sIcon.Icon; 137 | } 138 | } 139 | } 140 | } 141 | 142 | 143 | [XmlAttribute] 144 | public string Hotkey { get; set; } 145 | 146 | [XmlAttribute] 147 | public int WindowStyle { get; set; } 148 | 149 | [XmlAttribute] 150 | public bool DeployDisabled { get; set; } 151 | 152 | [XmlAttribute] 153 | public bool ACLDenyByDefault { get; set; } 154 | 155 | [XmlIgnore] 156 | public string FullPath { 157 | get => MenuPath + '\\' + DisplayName + ".lnk"; 158 | } 159 | 160 | [XmlIgnore] 161 | public String Filename 162 | { 163 | get => DisplayName + ".lnk"; 164 | } 165 | 166 | public void FindIcon(string SearchPath=null) 167 | { 168 | string ReplaceCDrivePath; 169 | 170 | string[] IconData = IconLocation.Split(','); 171 | string IconPath = ""; 172 | int IconIndex = 0; 173 | if (IconData.Count() == 2) 174 | { 175 | IconIndex = int.Parse(IconData[1]); 176 | IconPath = IconData[0]; 177 | } 178 | 179 | if (IconPath == "") 180 | IconPath = TargetPath; 181 | 182 | if (SearchPath != null) { 183 | string root = Path.GetPathRoot(SearchPath); 184 | //Check if is a UNC PATH, so replace C:\ with \\SERVER\SHARE\ 185 | if (root.StartsWith(@"\\")) 186 | { 187 | string[] segs = SearchPath.Split('\\'); 188 | ReplaceCDrivePath = @"\\" + segs[2] + @"\" + segs[3] + @"\"; 189 | IconPath = IconPath.Replace("C:\\", ReplaceCDrivePath); 190 | } 191 | } 192 | 193 | if (System.IO.File.Exists(IconPath)) 194 | { 195 | IconCacheLarge = ShellIcon.IconExtract(IconPath,IconIndex,1); 196 | IconCacheSmall = ShellIcon.IconExtract(IconPath, IconIndex); 197 | } 198 | } 199 | 200 | public bool IsDeployAllowed(List ACLMemberOf) 201 | { 202 | //Deployment is disabled 203 | if (DeployDisabled) return false; 204 | 205 | //There's no ACL Defined and the Is allowed by default 206 | if ((ACLMemberOf == null) & (ACLDenyByDefault == false)) return true; 207 | if ((ACLs.Count == 0) & (ACLDenyByDefault == false)) return true; 208 | 209 | bool bRet = false; 210 | 211 | foreach (ACL acl in ACLs) { 212 | foreach (string aclmemberof in ACLMemberOf) { 213 | //If ACL is disabled 214 | if (acl.SID == aclmemberof & acl.Disabled==false) 215 | { 216 | //If ACL is type of deny then return false 217 | if (acl.ACLType == ACLType.Deny) 218 | return false; 219 | bRet = true; 220 | } 221 | } 222 | } 223 | return bRet; 224 | } 225 | 226 | public bool Deploy(string StartMenuPath, string DesktopPath, List ACLMemberOf=null) 227 | { 228 | bool bDeploy; 229 | 230 | bDeploy = IsDeployAllowed(ACLMemberOf); 231 | 232 | if (bDeploy == false) return false; 233 | 234 | if (CheckIfTargetExists) //Check if target Exists is flagged, so check. 235 | { 236 | if (FileUtils.Exists(Environment.ExpandEnvironmentVariables(TargetPath)) == false) return false; 237 | } 238 | 239 | //Application 240 | if (PutOnStartMenu) { 241 | SaveShortcut(StartMenuPath + FullPath, StartMenuPath + MenuPath); 242 | } 243 | 244 | //Desktop 245 | if (PutOnDesktop) 246 | { 247 | try 248 | { 249 | SaveShortcut(DesktopPath + '\\' + DisplayName + ".lnk"); 250 | } catch 251 | { 252 | return false; 253 | } 254 | } 255 | 256 | return true; 257 | } 258 | 259 | private void SaveShortcut(string DestinationFilePath, string StartMenuFullPath = "") 260 | { 261 | WshShell WinShell = new WshShell(); 262 | WshShortcut WinShortcut; 263 | 264 | WinShortcut = WinShell.CreateShortcut(DestinationFilePath); 265 | 266 | //Set Shortcut Properties 267 | WinShortcut.TargetPath = TargetPath; 268 | WinShortcut.WorkingDirectory = WorkingDirectory; 269 | WinShortcut.Arguments = Arguments; 270 | WinShortcut.Hotkey = Hotkey; 271 | //If no Icon is specified then use default Icon of application (Useful for UWP Applications) 272 | if ( (IconLocation!=null) & ( IconLocation!="") ) 273 | WinShortcut.IconLocation = IconLocation; 274 | WinShortcut.WindowStyle = WindowStyle; 275 | 276 | if (StartMenuFullPath!="") { 277 | if (!Directory.Exists(StartMenuFullPath)) Directory.CreateDirectory(StartMenuFullPath); 278 | } 279 | 280 | WinShortcut.Save(); 281 | } 282 | 283 | public Shortcut() 284 | { 285 | ACLs = new ACLs(); 286 | WindowStyle = 1; 287 | ObjectID = Guid.NewGuid(); 288 | } 289 | } 290 | 291 | } 292 | -------------------------------------------------------------------------------- /DesktopComposer/Implementation/Shortcuts.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.ComponentModel; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Text; 8 | using DesktopComposer.Interfaces; 9 | using IWshRuntimeLibrary; 10 | 11 | namespace DesktopComposer.Implementation 12 | { 13 | public class Shortcuts : ObservableCollection 14 | { 15 | 16 | public void Add(string shortcutPath, string basePath=null) 17 | { 18 | //Open Shortcut File 19 | WshShell WinShell = new WshShell(); 20 | WshShortcut WinShortcut; 21 | Shortcut lShortcut; 22 | 23 | 24 | //REFACTOR: Method LoadFromFile in Shortcut 25 | WinShortcut = WinShell.CreateShortcut(shortcutPath); 26 | string relativePath = ""; 27 | string shortcutFileName = ""; 28 | 29 | // Check if is a MSI Package 30 | 31 | string shortcutTargetPath = WinShortcut.TargetPath; 32 | string sShortcut = null; 33 | 34 | if (WinShortcut.TargetPath.IndexOf("windows\\installer", 0, WinShortcut.TargetPath.Length,StringComparison.InvariantCultureIgnoreCase) > 0){ 35 | //Test MSI Shortcut 36 | sShortcut = MsiShortcutParser.ParseShortcut(shortcutPath); 37 | } 38 | 39 | if (sShortcut != null) shortcutTargetPath = sShortcut; 40 | 41 | foreach (Shortcut LocalShortcut in this) 42 | { 43 | //TODO: Add other criteria (e.g. Arguments) 44 | if (LocalShortcut.TargetPath == shortcutTargetPath) return; 45 | } 46 | 47 | //Relative Path 48 | if (basePath != null) 49 | { 50 | relativePath = shortcutPath.Replace(basePath, ""); 51 | } 52 | 53 | shortcutFileName = Path.GetFileName(shortcutPath); 54 | relativePath = Path.GetDirectoryName(relativePath); 55 | 56 | lShortcut = new Shortcut 57 | { 58 | DisplayName = Path.GetFileNameWithoutExtension(shortcutPath), 59 | TargetPath = shortcutTargetPath, 60 | WorkingDirectory = WinShortcut.WorkingDirectory, 61 | Arguments = WinShortcut.Arguments, 62 | Hotkey = WinShortcut.Hotkey, 63 | IconLocation = WinShortcut.IconLocation, 64 | ObjectID = Guid.NewGuid(), 65 | MenuPath = relativePath, 66 | WindowStyle = WinShortcut.WindowStyle, 67 | PutOnStartMenu = true 68 | }; 69 | lShortcut.FindIcon(shortcutPath); 70 | this.Add(lShortcut); 71 | } 72 | 73 | 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /DesktopComposer/Interfaces/IACL.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace DesktopComposer.Interfaces 7 | { 8 | public interface IACL 9 | { 10 | String SID { get; } 11 | String ObjectName { get; } 12 | Guid ObjectID { get; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DesktopComposer/Interfaces/IShortcut.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace DesktopComposer.Interfaces 7 | { 8 | public interface IShortcut 9 | { 10 | string MenuPath { get; } 11 | string TargetPath { get; } 12 | string DisplayName { get; } 13 | string FullPath { get; } 14 | Guid ObjectID { get; } 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /DesktopComposer/MsiShortcutParser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Runtime.InteropServices; 5 | 6 | namespace DesktopComposer 7 | { 8 | public static class MsiShortcutParser 9 | 10 | { 11 | 12 | /* 13 | 14 | UINT MsiGetShortcutTarget( 15 | 16 | LPCTSTR szShortcutTarget, 17 | 18 | LPTSTR szProductCode, 19 | 20 | LPTSTR szFeatureId, 21 | 22 | LPTSTR szComponentCode 23 | 24 | ); 25 | 26 | */ 27 | 28 | [DllImport("msi.dll", CharSet = CharSet.Auto)] 29 | 30 | static extern int MsiGetShortcutTarget(string targetFile, StringBuilder productCode, StringBuilder featureID, StringBuilder componentCode); 31 | 32 | 33 | 34 | public enum InstallState 35 | 36 | { 37 | 38 | NotUsed = -7, 39 | 40 | BadConfig = -6, 41 | 42 | Incomplete = -5, 43 | 44 | SourceAbsent = -4, 45 | 46 | MoreData = -3, 47 | 48 | InvalidArg = -2, 49 | 50 | Unknown = -1, 51 | 52 | Broken = 0, 53 | 54 | Advertised = 1, 55 | 56 | Removed = 1, 57 | 58 | Absent = 2, 59 | 60 | Local = 3, 61 | 62 | Source = 4, 63 | 64 | Default = 5 65 | 66 | } 67 | 68 | 69 | 70 | public const int MaxFeatureLength = 38; 71 | 72 | public const int MaxGuidLength = 38; 73 | 74 | public const int MaxPathLength = 1024; 75 | 76 | 77 | 78 | /* 79 | 80 | INSTALLSTATE MsiGetComponentPath( 81 | 82 | LPCTSTR szProduct, 83 | 84 | LPCTSTR szComponent, 85 | 86 | LPTSTR lpPathBuf, 87 | 88 | DWORD* pcchBuf 89 | 90 | ); 91 | 92 | */ 93 | 94 | [DllImport("msi.dll", CharSet = CharSet.Auto)] 95 | 96 | static extern InstallState MsiGetComponentPath(string productCode, string componentCode, StringBuilder componentPath, ref int componentPathBufferSize); 97 | 98 | 99 | 100 | public static string ParseShortcut(string file) 101 | 102 | { 103 | 104 | StringBuilder product = new StringBuilder(MaxGuidLength + 1); 105 | 106 | StringBuilder feature = new StringBuilder(MaxFeatureLength + 1); 107 | 108 | StringBuilder component = new StringBuilder(MaxGuidLength + 1); 109 | 110 | 111 | 112 | MsiGetShortcutTarget(file, product, feature, component); 113 | 114 | 115 | 116 | int pathLength = MaxPathLength; 117 | 118 | StringBuilder path = new StringBuilder(pathLength); 119 | 120 | 121 | 122 | InstallState installState = MsiGetComponentPath(product.ToString(), component.ToString(), path, ref pathLength); 123 | 124 | if (installState == InstallState.Local) 125 | 126 | { 127 | 128 | return path.ToString(); 129 | 130 | } 131 | 132 | else 133 | 134 | { 135 | return null; 136 | } 137 | 138 | } 139 | 140 | } 141 | 142 | } 143 | -------------------------------------------------------------------------------- /DesktopComposer/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // Le informazioni generali relative a un assembly sono controllate dal seguente 6 | // set di attributi. Modificare i valori di questi attributi per modificare le informazioni 7 | // associate a un assembly. 8 | [assembly: AssemblyTitle("DesktopComposer")] 9 | [assembly: AssemblyDescription("Desktop Composer Main Logic Library")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DesktopComposer")] 13 | [assembly: AssemblyCopyright("Copyright © Sequence Software 2020")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Se si imposta ComVisible su false, i tipi in questo assembly non saranno visibili 18 | // ai componenti COM. Se è necessario accedere a un tipo in questo assembly da 19 | // COM, impostare su true l'attributo ComVisible per tale tipo. 20 | [assembly: ComVisible(false)] 21 | 22 | // Se il progetto viene esposto a COM, il GUID seguente verrà utilizzato come ID della libreria dei tipi 23 | [assembly: Guid("4f905302-b08e-414c-9e4a-c21d4c0958ef")] 24 | 25 | // Le informazioni sulla versione di un assembly sono costituite dai seguenti quattro valori: 26 | // 27 | // Versione principale 28 | // Versione secondaria 29 | // Numero di build 30 | // Revisione 31 | // 32 | // È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build 33 | // usando l'asterisco '*' come illustrato di seguito: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("0.9.2.1")] 36 | [assembly: AssemblyFileVersion("0.9.2.1")] 37 | -------------------------------------------------------------------------------- /DesktopComposer/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Riccardo Bicelli 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Buy Me A Coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/rbicelli) 2 | 3 | # DesktopComposer 4 | 5 | This is a software designed to simplify the task of managing Windows Start Menu and Desktop Shortcuts (and hopefully in the future some other Desktop related settings) for Windows 10 and Windows Server 2019 in an Active Directory environment. 6 | 7 | ![](images/screenshot.png?raw=true) 8 | 9 | DesktopComposer is made of two programs: 10 | 11 | - ComposerAdmin: GUI program use to build Start Menus 12 | - ComposerAgent: Agent program which runs at user logon/logoff and creates the Start Menu according to settings defined in ComposerAdmin 13 | 14 | ## ComposerAdmin Features 15 | 16 | - Build a Start Menu from scratch (creates Menus and Shortcuts) in an easy and friendly way 17 | - Import Shortcuts from Local Start Menu 18 | - Import Shortcuts from other Computer in same Network (e.g. your terminal server) 19 | - Import Shortcuts from Folder 20 | - Define Shortcut Properties: Put on Desktop, Put on Start Menu, Set ACL on Shortcuts 21 | 22 | ## ComposerAgent Features 23 | 24 | - Self disabling access of Common Start Menu and Common Desktop of Composition enabled users 25 | - Deploy Shortcuts according to composition rules set in ACL 26 | - Agent Settings are manageable via Group Policy, with inclued ADMX templates 27 | 28 | # Installation 29 | 30 | ## System Requirements 31 | 32 | - An Active Directory Domain 33 | - For the agents, Windows Server 2019 or Windows 10 34 | 35 | ## Prepare the required environment 36 | 37 | Grab setup files in [releases](https://github.com/rbicelli/DesktopComposer/releases/). 38 | 39 | - Install Shortcuts Editor on administrator machine, typically the one you use to manage Group Policies ordirectly on your Terminal Server. 40 | - Create a folder widely accessible in Read-Only mode for the end user where you will put composition file, typically a subfolder under NETLOGON, eg. **\\\\MYDOMAIN\NETLOGON\DesktopComposerFiles**. 41 | - Create your first start menu, save the file in the directory, for exampe **\\\\MYDOMAIN\netlogon\dcomposer\rd-servers.dcxml** 42 | 43 | ## Deploy Agents 44 | 45 | Install ComposerAgent on every computer you wish to deploy Start Menus and Desktop Settings. 46 | 47 | You can deploy Agents silently calling the setup executable with /VERYSILENT flag: 48 | 49 | ``` 50 | ComposerAgentSetup-%VERSION%.exe /VERYSILENT 51 | ``` 52 | 53 | ## Create the required Group Policy Objects 54 | 55 | First you need to deploy ADMX templates to your Windows Policy Folder or the Central Store. 56 | 57 | Open ADMX Folder (You can easily access is under **Start Menu->Desktop Composer->ADMX Template Folder**) and copy the content of the folder to **C:\Windows\PolicyDefinitions** or to the central store of your AD Domain. 58 | 59 | Open the Group Policy Management Snap-In and create the Group Policy 60 | 61 | These instructions are for a typical RDS Server Farm setup, consider an organizational structure like this: 62 | 63 | 64 | ``` 65 | + Domain 66 | + RD Farm 67 | + RD Session Hosts 68 | - RDS Server 01 69 | ``` 70 | 71 | Create a GPO and link it to the **RD Session Hosts** OU. 72 | 73 | Then Edit the GPO just created. 74 | 75 | ### Computer Settings 76 | 77 | 1. Set the Group Policy Loopback Prcessing Mode to Merge: 78 | 79 | Open **Computer Configuration\Policies\Administrative Templates\System\Group Policy\Configure user Group Policy loopback processing mode**, set it to **Enabled** and **Merge** 80 | This will apply th user policy to users logged in to computer 81 | 82 | 2. Add users to DesktopComposer Local User Group: 83 | 84 | Open **Computer Configuration\Preferences\Control Panel Settings\Local Users and Groups**, then create new local group called **DesktopComposer Users** and add as members the needed Users groups. 85 | 86 | 87 | ### User Settings 88 | 89 | 1. Open **User Configuration\Windows Settings\Scripts (Logon/Logoff)\Logon**, add a new logon script: 90 | - **Script Name**: %PROGRAMFILES%\Sequence Software\Composer Agent\ComposerAgent.exe 91 | - **Script Parameters:** -compose 92 | 93 | This will trigger the Composition of Start Menu and Desktop Shortcuts at User Logon 94 | 95 | 2. (optional) Open **User Configuration\Windows Settings\Scripts (Logon/Logoff)\Logoff**, add a new logonff script, 96 | - **Script Name**: %PROGRAMFILES%\Sequence Software\Composer Agent\ComposerAgent.exe 97 | - **Script Parameters:** -decompose 98 | 99 | This will restore the initial Start Menu and Desktop Shortcuts at user User Logoff 100 | 101 | ### ComposerAgent Settings 102 | 103 | Open **User Configuration\Administrative Templates\Sequence Software\DesktopComposer Agent** 104 | 105 | 1. Set **Enable Composition Agent** to **Enabled** 106 | 107 | 2. Set **Composition File Location** to the composition file previously saved (e.g. **\\\\MYDOMAIN\netlogon\dcomposer\rd-servers.dcxml** ) 108 | 109 | 3. Optionally you can set the **Log File Location** (e.g. **%TEMP%\COMPOSERLOG.LOG**) and **Log Threshold**. By default it saves logs in %APPDATA%. 110 | 111 | ## Troubleshooting 112 | 113 | If you have problems first check the logs. You could raise the verbosity of logs simply editing the **Log Threshold** GPO Item. 114 | For further troubleshooting you can open a console and launch the agent Manually: 115 | 116 | ``` 117 | %PROGRAMFILES%\Sequence Software\Composer Agent\ComposerAgent.exe 118 | 119 | Commandline Args are: 120 | -compose: run the composition 121 | -decompose: restores initial state 122 | -install: install related tasks (creates Local User Group and sets Deny ACLs on common Desktop and Common Start Menu) 123 | -uninstall: uninstall related tasks (rollback install) 124 | 125 | NOTE: Install and uninstall requires elevated privileges and are executed by the installer/uninstaller. 126 | ``` 127 | 128 | # License 129 | 130 | This software is released under the MIT License. -------------------------------------------------------------------------------- /Setup/Setup-ComposerAdmin.iss: -------------------------------------------------------------------------------- 1 | ; Script generated by the Inno Script Studio Wizard. 2 | ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! 3 | 4 | #define MyAppName "Composition Editor" 5 | #define MyAppVersion "0.9.3" 6 | #define MyAppVersionText "0.9" 7 | #define MyAppURL "https://github.com/rbicelli/DesktopComposer" 8 | #define MyAppExeName "ComposerAdmin.exe" 9 | #define MyAppProductName "ComposerAdmin" 10 | #define MyAppPublisher "Sequence Software" 11 | #define MyAppAuthor "Riccardo Bicelli" 12 | #define MyAppURL "https://github.com/rbicelli/DesktopComposer" 13 | #define MyAppDescription "Desktop Composition Editor" 14 | #define MyAppGroupName "Desktop Composer" 15 | 16 | [Setup] 17 | ; NOTE: The value of AppId uniquely identifies this application. 18 | ; Do not use the same AppId value in installers for other applications. 19 | ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) 20 | AppId={{1236C866-B49A-4715-AD91-B89BFB666280}} 21 | AppName={#MyAppName} 22 | AppVersion={#MyAppVersion} 23 | AppPublisher={#MyAppPublisher} 24 | AppPublisherURL={#MyAppURL} 25 | AppSupportURL={#MyAppURL} 26 | AppUpdatesURL={#MyAppURL} 27 | DefaultDirName={commonpf}\Sequence Software\Composer Admin 28 | DefaultGroupName={#MyAppGroupName} 29 | OutputBaseFilename=ComposerAdminSetup-{#MyAppVersion} 30 | Compression=lzma 31 | SolidCompression=yes 32 | AppCopyright={#MyAppPublisher} 2020 33 | AllowUNCPath=False 34 | UninstallDisplayName={#MyAppName} 35 | UninstallDisplayIcon={app}\{#MyAppExeName} 36 | VersionInfoVersion={#MyAppversion} 37 | VersionInfoCompany={#MyAppPublisher} 38 | VersionInfoDescription={#MyAppDescription} 39 | VersionInfoTextVersion={#MyAppVersiontext} 40 | VersionInfoCopyright=2020 {#MyAppAuthor} 41 | VersionInfoProductName={#MyAppProductName} 42 | VersionInfoProductVersion={#MyAppVersion} 43 | VersionInfoProductTextVersion={#MyAppVersiontext} 44 | MinVersion=0,6.0 45 | ArchitecturesInstallIn64BitMode=x64 46 | LicenseFile=..\LICENSE 47 | 48 | [Tasks] 49 | Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked 50 | 51 | [Files] 52 | Source: "..\ComposerAdmin\bin\Release\ComposerAdmin.exe"; DestDir: "{app}"; Flags: ignoreversion; MinVersion: 0,6.1 53 | ;Source: "..\ComposerAdmin\bin\Release\Resources\*"; DestDir: "{app}\Resources\"; Flags: ignoreversion recursesubdirs createallsubdirs 54 | Source: "..\ComposerAdmin\Tools\ADMX\*"; DestDir: "{app}\Tools\ADMX"; Flags: ignoreversion recursesubdirs createallsubdirs 55 | Source: "..\ComposerAdmin\bin\Release\ActiveDirectoryObjectPicker.dll"; DestDir: "{app}"; Flags: ignoreversion 56 | Source: "..\ComposerAdmin\bin\Release\ActiveDirectoryObjectPicker.xml"; DestDir: "{app}"; Flags: ignoreversion 57 | Source: "..\ComposerAdmin\bin\Release\DesktopComposer.dll"; DestDir: "{app}"; Flags: ignoreversion 58 | Source: "..\ComposerAdmin\bin\Release\IconLib.dll"; DestDir: "{app}"; Flags: ignoreversion 59 | Source: "..\ComposerAdmin\bin\Release\IconLib.xml"; DestDir: "{app}"; Flags: ignoreversion 60 | Source: "..\LICENSE"; DestDir: "{app}"; Flags: ignoreversion 61 | ;Source: "..\ComposerAdmin\bin\Release\Newtonsoft.Json.dll"; DestDir: "{app}"; Flags: ignoreversion 62 | ;Source: "..\ComposerAdmin\bin\Release\Newtonsoft.Json.xml"; DestDir: "{app}"; Flags: ignoreversion 63 | ; NOTE: Don't use "Flags: ignoreversion" on any shared system files 64 | 65 | [Icons] 66 | Name: "{group}\Composition Editor"; Filename: "{app}\ComposerAdmin.exe"; WorkingDir: "{app}"; IconFilename: "{app}\ComposerAdmin.exe"; IconIndex: 0 67 | Name: "{commondesktop}\Composition Editor"; Filename: "{app}\ComposerAdmin.exe"; IconFilename: "{app}\ComposerAdmin.exe"; IconIndex: 0; Tasks: desktopicon 68 | Name: "{group}\ADMX Templates Folder"; Filename: "{app}\Tools\ADMX"; WorkingDir: "{app}" 69 | -------------------------------------------------------------------------------- /Setup/Setup-ComposerAgent.iss: -------------------------------------------------------------------------------- 1 | ; Script generated by the Inno Script Studio Wizard. 2 | ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! 3 | 4 | #define MyAppName "Desktop Composer Agent" 5 | #define MyAppProductName "ComposerAgent" 6 | #define MyAppVersion "0.9.3" 7 | #define MyAppVersionText "0.9" 8 | #define MyAppPublisher "Sequence Software" 9 | #define MyAppAuthor "Riccardo Bicelli" 10 | #define MyAppURL "https://github.com/rbicelli/DesktopComposer" 11 | #define MyAppExeName "ComposerAgent.exe" 12 | #define MyAppDescription "Desktop Composition Agent" 13 | #define MyAppGroupName "Desktop Composer" 14 | 15 | 16 | [Setup] 17 | ; NOTE: The value of AppId uniquely identifies this application. 18 | ; Do not use the same AppId value in installers for other applications. 19 | ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) 20 | AppId={{46D19B75-D181-46EE-B688-204C5FC19A2E}} 21 | AppName={#MyAppName} 22 | AppVersion={#MyAppVersion} 23 | AppPublisher={#MyAppPublisher} 24 | AppPublisherURL={#MyAppURL} 25 | AppSupportURL={#MyAppURL} 26 | AppUpdatesURL={#MyAppURL} 27 | DefaultDirName={commonpf}\Sequence Software\Composer Agent 28 | DefaultGroupName={#MyAppGroupName} 29 | OutputBaseFilename=ComposerAgentSetup-{#MyAppVersion} 30 | Compression=lzma 31 | SolidCompression=yes 32 | AppCopyright={#MyAppPublisher} 2020 33 | AllowUNCPath=False 34 | UninstallDisplayName={#MyAppName} 35 | UninstallDisplayIcon={app}\{#MyAppExeName} 36 | VersionInfoVersion={#MyAppversion} 37 | VersionInfoCompany={#MyAppPublisher} 38 | VersionInfoDescription={#MyAppDescription} 39 | VersionInfoTextVersion={#MyAppVersiontext} 40 | VersionInfoCopyright=2020 {#MyAppAuthor} 41 | VersionInfoProductName={#MyAppProductName} 42 | VersionInfoProductVersion={#MyAppVersion} 43 | VersionInfoProductTextVersion={#MyAppVersiontext} 44 | MinVersion=0,6.0 45 | ArchitecturesInstallIn64BitMode=x64 46 | LicenseFile=..\LICENSE 47 | 48 | [Files] 49 | Source: "..\ComposerAgent\bin\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion; MinVersion: 0,6.1 50 | Source: "..\ComposerAgent\bin\Release\DesktopComposer.dll"; DestDir: "{app}"; Flags: ignoreversion 51 | Source: "..\ComposerAgent\bin\Release\IconLib.dll"; DestDir: "{app}"; Flags: ignoreversion 52 | Source: "..\ComposerAgent\bin\Release\IconLib.xml"; DestDir: "{app}"; Flags: ignoreversion 53 | Source: "..\LICENSE"; DestDir: "{app}"; Flags: ignoreversion 54 | 55 | [Run] 56 | Filename: "{app}\ComposerAgent.exe"; Parameters: "-install -noconsole"; WorkingDir: "{app}"; Flags: postinstall runhidden 57 | 58 | [UninstallRun] 59 | Filename: "{app}\ComposerAgent.exe"; Parameters: "-uninstall -noconsole"; WorkingDir: "{app}"; Flags: runhidden 60 | -------------------------------------------------------------------------------- /images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rbicelli/DesktopComposer/081c4f98fca384465eb82215a85fb369dfb1b66c/images/screenshot.png --------------------------------------------------------------------------------