拖放msi文件到本脚本读取其基本信息

/* 
Script:   MSI Information 
Info:   Displays basic Windows Installer File (*.msi) information 
Author:   Ferry van Gelderen 
Date:   25-01-2012 
*/ 

#SingleInstance off 
#NoEnv 
SetBatchLines -1 
SendMode Input 
SetWorkingDir %A_ScriptDir% 
ComObjError(false) 
Version = 1.1 
MainTitle = MSI Information %Version% 

MSIFile = %1% 

IfExist, %MSIFile% 
   { 
   msiOpenDatabaseModeReadOnly := 0 
   installer := ComObjCreate("WindowsInstaller.Installer") 
   openMode := msiOpenDatabaseModeReadOnly       
   database := installer.OpenDatabase(MSIFile, openMode) 
   If !database 
      { 
      MsgBox, 16, %MainTitle%, Could not read the file %MSIFile%. Make sure this is a Windows Installer File (*.msi). 
      ExitApp, 1 
      } 
   Product := installer.SummaryInformation(MSIFile) 
   CodePage := Product.Property(1) 
   Title := Product.Property(2) 
   Subject := Product.Property(3) 
   Author := Product.Property(4) 
   Keywords := Product.Property(5) 
   Comments := Product.Property(6) 
   Template := Product.Property(7) 
   LastAuthor := Product.Property(8) 
   PackageCode := Product.Property(9) 
   LastPrinted := Product.Property(11) 
   CreateTimeDate := Product.Property(12) 
   LastSavedTimeDate := Product.Property(13) 
   PageCount := Product.Property(14) 
   WordCount := Product.Property(15) 
   CreatingApplication := Product.Property(18) 
   Security := Product.Property(19) 
   objRelease(installer) 

   ProductName := ProductName(MSIFile) 
   Manufacturer := Manufacturer(MSIFile) 
   ProductCode := ProductCode(MSIFile) 
   UpgradeCode := UpgradeCode(MSIFile) 
   ProductVersion := ProductVersion(MSIFile) 
    
   Gui, 1:-Resize 
   Gui, 1:Margin, 5, 5 
   Gui, 1:Font, s8 bold 
   Gui, 1:Add, GroupBox, x5 y5 w400 h300, Summary Information 
   Gui, 1:Font, norm 
   Gui, 1:Add, Text, x10 y30 w80 c808080, Title : 
   Gui, 1:Add, Edit, x90 y25 w310 r1 Readonly, %Title% 
   Gui, 1:Add, Text, x10 y55 w80 c808080, Author : 
   Gui, 1:Add, Edit, x90 y50 w310 r1 Readonly, %Author%    
   Gui, 1:Add, Text, x10 y80 w80 c808080, Subject : 
   Gui, 1:Add, Edit, x90 y75 w310 r1 Readonly, %Subject% 
   Gui, 1:Add, Text, x10 y105 w80 c808080, Keywords : 
   Gui, 1:Add, Edit, x90 y100 w310 r1 Readonly, %Keywords%    
   Gui, 1:Add, Text, x10 y130 w80 c808080, Comments : 
   Gui, 1:Add, Edit, x90 y125 w310 r1 Readonly, %Comments% 
   Gui, 1:Add, Text, x10 y155 w80 c808080, Package Code : 
   Gui, 1:Add, Edit, x90 y150 w310 r1 Readonly, %PackageCode%    
   StringSplit, Template_Array, Template, ';, 
   Gui, 1:Add, Text, x10 y180 w80 c808080, Platform : 
   Gui, 1:Add, Edit, x90 y175 w310 r1 Readonly, %Template_Array1%       
   Gui, 1:Add, Text, x10 y205 w80 c808080, Languages : 
   Gui, 1:Add, Edit, x90 y200 w310 r1 Readonly, %Template_Array2%    
   Gui, 1:Add, Text, x10 y230 w80 c808080, Schema : 
   Gui, 1:Add, Edit, x90 y225 w310 r1 Readonly, %PageCount% 
   Gui, 1:Add, Text, x10 y255 w80 c808080, Security : 
   Gui, 1:Add, Edit, x90 y250 w310 r1 Readonly, %Security%       
   Gui, 1:Add, Text, x10 y280 w80 c808080, WordCount : 
   Gui, 1:Add, Edit, x90 y275 w310 r1 Readonly, %WordCount%       
   Gui, 1:Font, s8 bold    
   Gui, 1:Add, GroupBox, x5 y305 w400 h150, Properties 
   Gui, 1:Font, norm    
   Gui, 1:Add, Text, x10 y330 w80 c808080, Name : 
   Gui, 1:Add, Edit, x90 y325 w310 r1 Readonly, %ProductName% 
   Gui, 1:Add, Text, x10 y355 w80 c808080, Version : 
   Gui, 1:Add, Edit, x90 y350 w310 r1 Readonly, %ProductVersion% 
   Gui, 1:Add, Text, x10 y380 w80 c808080, Manufacturer : 
   Gui, 1:Add, Edit, x90 y375 w310 r1 Readonly, %Manufacturer% 
   Gui, 1:Add, Text, x10 y405 w80 c808080, Product Code : 
   Gui, 1:Add, Edit, x90 y400 w310 r1 Readonly, %ProductCode% 
   Gui, 1:Add, Text, x10 y430 w80 c808080, Upgrade Code : 
   Gui, 1:Add, Edit, x90 y425 w310 r1 Readonly, %UpgradeCode% 
   Gui, 1:Font, s8 bold    
   Gui, 1:Add, GroupBox, x5 y455 w400 h100, About 
   Gui, 1:Font, norm 
   Gui, 1:Add, Text, x10 y475 w390 h75 c808080, MSI Information %Version% is designed to read basic information from a Microsoft Installer File (*.msi). This software is provided "as is". Use of the software is free and at your own risk.`n`nCopyright (c) 2012 Ferry van Gelderen 
   SplitPath, MSIFILE, MSIName 
   Gui, 1:Show,, %MainTitle% (%MSIName%) 
   Return 
   } 
Else 
   MsgBox, 64, MSI Information %Version%, Drop a Microsoft Windows Installer File (*.msi) on this program (%A_ScriptName%) to view basic MSI information.`n`nCopyright (c) 2012 Ferry van Gelderen 
ExitApp, 0 

Guiclose: 
   ExitApp, 0 
Return 

ProductName(MSIFile) 
   { 
   msiOpenDatabaseModeReadOnly := 0 
   installer := ComObjCreate("WindowsInstaller.Installer") 
   openMode := msiOpenDatabaseModeReadOnly       
   database := installer.OpenDatabase(MSIFile, openMode) 
   view := database.OpenView("SELECT `Value` FROM `Property` WHERE `Property` = 'ProductName'") 
   view.Execute 
   record := view.Fetch 
   ProductName := record.StringData(1) 
   objRelease(installer) 
   Return ProductName 
   } 

ProductCode(MSIFile) 
   { 
   msiOpenDatabaseModeReadOnly := 0 
   installer := ComObjCreate("WindowsInstaller.Installer") 
   openMode := msiOpenDatabaseModeReadOnly       
   database := installer.OpenDatabase(MSIFile, openMode) 
   view := database.OpenView("SELECT `Value` FROM `Property` WHERE `Property` = 'ProductCode'") 
   view.Execute 
   record := view.Fetch 
   ProductCode := record.StringData(1) 
   objRelease(installer) 
   Return ProductCode 
   } 

UpgradeCode(MSIFile) 
   { 
   msiOpenDatabaseModeReadOnly := 0 
   installer := ComObjCreate("WindowsInstaller.Installer") 
   openMode := msiOpenDatabaseModeReadOnly       
   database := installer.OpenDatabase(MSIFile, openMode) 
   view := database.OpenView("SELECT `Value` FROM `Property` WHERE `Property` = 'UpgradeCode'") 
   view.Execute 
   record := view.Fetch 
   UpgradeCode := record.StringData(1) 
   objRelease(installer) 
   Return UpgradeCode 
   } 
    
ProductVersion(MSIFile) 
   { 
   msiOpenDatabaseModeReadOnly := 0 
   installer := ComObjCreate("WindowsInstaller.Installer") 
   openMode := msiOpenDatabaseModeReadOnly       
   database := installer.OpenDatabase(MSIFile, openMode) 
   view := database.OpenView("SELECT `Value` FROM `Property` WHERE `Property` = 'ProductVersion'") 
   view.Execute 
   record := view.Fetch 
   ProductVersion := record.StringData(1) 
   objRelease(installer) 
   Return ProductVersion 
   } 
    
Manufacturer(MSIFile) 
   { 
   msiOpenDatabaseModeReadOnly := 0 
   installer := ComObjCreate("WindowsInstaller.Installer") 
   openMode := msiOpenDatabaseModeReadOnly       
   database := installer.OpenDatabase(MSIFile, openMode) 
   view := database.OpenView("SELECT `Value` FROM `Property` WHERE `Property` = 'Manufacturer'") 
   view.Execute 
   record := view.Fetch 
   Manufacturer := record.StringData(1) 
   objRelease(installer)    
   Return Manufacturer 
   } 

给TA捐赠
共{{data.count}}人
人已捐赠
其他

批量转换编码

2020-3-9 2:51:44

其他

拖放窗口

2020-3-9 2:53:44

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索