Thread: [Meta-diff-devel] SF.net SVN: meta-diff: [111] trunk/setup/metadiff.iss
Brought to you by:
undees
From: <ey...@us...> - 2007-10-10 21:26:18
|
Revision: 111 http://meta-diff.svn.sourceforge.net/meta-diff/?rev=111&view=rev Author: eyebex Date: 2007-10-10 14:26:15 -0700 (Wed, 10 Oct 2007) Log Message: ----------- Minor fixes due to new directory layout. Modified Paths: -------------- trunk/setup/metadiff.iss Modified: trunk/setup/metadiff.iss =================================================================== --- trunk/setup/metadiff.iss 2007-10-10 21:25:44 UTC (rev 110) +++ trunk/setup/metadiff.iss 2007-10-10 21:26:15 UTC (rev 111) @@ -95,7 +95,7 @@ DefaultDirName={pf}\{#emit APP_NAME} DefaultGroupName={#emit APP_NAME} DisableStartupPrompt=yes -LicenseFile=..\CompareShellEx\CompareShellEx-License.txt +LicenseFile=..\meta-diff\license.txt WizardImageFile=meta-diff-large.bmp WizardSmallImageFile=meta-diff-small.bmp @@ -112,7 +112,7 @@ Name: src; Description: Full C++ / Delphi source code; Types: full [Files] -Source: ..\InstallerScripts\metadiff.iss; DestDir: {app}\source; Components: src +Source: metadiff.iss; DestDir: {app}\source; Components: src ; meta-diff Source: ..\meta-diff\.metadiff; DestDir: {app}; Components: main; Flags: confirmoverwrite @@ -140,16 +140,16 @@ Source: ..\lv-diff\lvdiff.vcproj; DestDir: {app}\source\lv-diff; Components: src ; CompareShellEx -Source: ..\CompareShellEx\CompareShellEx.dll; DestDir: {app}; Components: cse; Flags: uninsrestartdelete -Source: ..\CompareShellEx\CompareShellEx-Install.bat; DestDir: {app}; Components: cse -Source: ..\CompareShellEx\CompareShellEx-License.txt; DestDir: {app}; Components: cse -Source: ..\CompareShellEx\CompareShellEx-ReadMe.txt; DestDir: {app}; Components: cse -Source: ..\CompareShellEx\CompareShellEx-Uninstall.bat; DestDir: {app}; Components: cse +Source: ..\shell\CompareShellEx\CompareShellEx.dll; DestDir: {app}; Components: cse; Flags: uninsrestartdelete +Source: ..\shell\CompareShellEx\CompareShellEx-Install.bat; DestDir: {app}; Components: cse +Source: ..\shell\CompareShellEx\CompareShellEx-License.txt; DestDir: {app}; Components: cse +Source: ..\shell\CompareShellEx\CompareShellEx-ReadMe.txt; DestDir: {app}; Components: cse +Source: ..\shell\CompareShellEx\CompareShellEx-Uninstall.bat; DestDir: {app}; Components: cse -Source: ..\CompareShellEx\CompareShellEx.bdsproj; DestDir: {app}\source\CompareShellEx; Components: src -Source: ..\CompareShellEx\CompareShellEx.dpr; DestDir: {app}\source\CompareShellEx; Components: src -Source: ..\CompareShellEx\CompareShellEx.lc; DestDir: {app}\source\CompareShellEx; Components: src -Source: ..\CompareShellEx\CompareShellEx.res; DestDir: {app}\source\CompareShellEx; Components: src +Source: ..\shell\CompareShellEx\CompareShellEx.bdsproj; DestDir: {app}\source\CompareShellEx; Components: src +Source: ..\shell\CompareShellEx\CompareShellEx.dpr; DestDir: {app}\source\CompareShellEx; Components: src +Source: ..\shell\CompareShellEx\CompareShellEx.lc; DestDir: {app}\source\CompareShellEx; Components: src +Source: ..\shell\CompareShellEx\CompareShellEx.res; DestDir: {app}\source\CompareShellEx; Components: src [Icons] Name: {group}\Uninstall meta-diff; Filename: {uninstallexe} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ey...@us...> - 2007-10-10 22:36:09
|
Revision: 112 http://meta-diff.svn.sourceforge.net/meta-diff/?rev=112&view=rev Author: eyebex Date: 2007-10-10 15:36:04 -0700 (Wed, 10 Oct 2007) Log Message: ----------- Store config files now in user's app data directory (still need to implement copying configs from a previous installation). Modified Paths: -------------- trunk/setup/metadiff.iss Modified: trunk/setup/metadiff.iss =================================================================== --- trunk/setup/metadiff.iss 2007-10-10 21:26:15 UTC (rev 111) +++ trunk/setup/metadiff.iss 2007-10-10 22:36:04 UTC (rev 112) @@ -17,14 +17,23 @@ APP_VER [Code] +const + CSIDL_APPDATA=$001a; + +function GetConfigFolder(Param:string):string; +begin + // Ignore the "Param" argument. + Result:=GetShellFolderByCSIDL(CSIDL_APPDATA,False); +end; + var ProgramPage:TInputFileWizardPage; procedure InitializeWizard; begin // Use a mono spaced font in the license dialog. - //WizardForm.LicenseMemo.Font.Name:='Courier New'; - //WizardForm.LicenseMemo.Font.Size:=8; + WizardForm.LicenseMemo.Font.Name:='Lucida Console'; + WizardForm.LicenseMemo.Font.Size:=7; // Create a custom page to specify comparison programs. ProgramPage:=CreateInputFilePage( @@ -55,10 +64,11 @@ // ssInstall - Just before the actual installation starts // ssPostInstall - Just after the actual installation finishes // ssDone - Just before Setup terminates after a successful install - if CurStep<>ssDone then + if CurStep<>ssDone then begin Exit; + end; - ConfigFile:=ExpandConstant('{app}\.metadiff'); + ConfigFile:=ExpandConstant('{userappdata}\.metadiff'); // Add the programs to the configuration file. DirProgram:=RemoveQuotes(Trim(ProgramPage.Values[0])); @@ -72,9 +82,9 @@ end; // Only add '*.vi ' to the config file if there is no such entry yet. - if LoadStringFromFile(ConfigFile,ConfigData) then - if Pos('*.vi ',ConfigData)>0 then - Exit; + if LoadStringFromFile(ConfigFile,ConfigData) and (Pos('*.vi ',ConfigData)>0) then begin + Exit; + end; lvdiff:=ExpandConstant('{app}\lvdiff.exe'); if FileExists(lvdiff) then begin @@ -115,7 +125,7 @@ Source: metadiff.iss; DestDir: {app}\source; Components: src ; meta-diff -Source: ..\meta-diff\.metadiff; DestDir: {app}; Components: main; Flags: confirmoverwrite +Source: ..\meta-diff\.metadiff; DestDir: {code:GetConfigFolder}; Components: main; Flags: confirmoverwrite Source: ..\meta-diff\license.txt; DestDir: {app}; DestName: metadiff-license.txt; Components: main Source: ..\meta-diff\metadiff.exe; DestDir: {app}; Components: main Source: ..\meta-diff\readme.txt; DestDir: {app}; DestName: metadiff-readme.txt; Components: main; Flags: isreadme @@ -127,7 +137,7 @@ Source: ..\meta-diff\metadiff.vcproj; DestDir: {app}\source\meta-diff; Components: src ; LVDiff -Source: ..\lv-diff\.lvdiff; DestDir: {app}; Components: lvdiff; Flags: confirmoverwrite +Source: ..\lv-diff\.lvdiff; DestDir: {code:GetConfigFolder}; Components: lvdiff; Flags: confirmoverwrite Source: ..\lv-diff\license.txt; DestDir: {app}; DestName: lvdiff-license.txt; Components: lvdiff Source: ..\lv-diff\lvdiff.exe; DestDir: {app}; Components: lvdiff Source: ..\lv-diff\*.vi; DestDir: {app}; Components: lvdiff This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ey...@us...> - 2007-10-11 00:01:36
|
Revision: 113 http://meta-diff.svn.sourceforge.net/meta-diff/?rev=113&view=rev Author: eyebex Date: 2007-10-10 17:01:17 -0700 (Wed, 10 Oct 2007) Log Message: ----------- Copy any existing config files from a previous installation to the user's app data directory. Modified Paths: -------------- trunk/setup/metadiff.iss Modified: trunk/setup/metadiff.iss =================================================================== --- trunk/setup/metadiff.iss 2007-10-10 22:36:04 UTC (rev 112) +++ trunk/setup/metadiff.iss 2007-10-11 00:01:17 UTC (rev 113) @@ -26,7 +26,20 @@ Result:=GetShellFolderByCSIDL(CSIDL_APPDATA,False); end; +function GetPathInstalled(AppID:string):string; var + PrevPath,Key,Value:string; +begin + Result:=''; + Key:='Software\Microsoft\Windows\CurrentVersion\Uninstall\'+AppID+'_is1'; + Value:='Inno Setup: App Path'; + if RegQueryStringValue(HKLM,Key,Value,PrevPath) or RegQueryStringValue(HKCU,Key,Value,PrevPath) then begin + Result:=PrevPath; + end; +end; + +var + ConfigExisted:Boolean; ProgramPage:TInputFileWizardPage; procedure InitializeWizard; @@ -34,26 +47,6 @@ // Use a mono spaced font in the license dialog. WizardForm.LicenseMemo.Font.Name:='Lucida Console'; WizardForm.LicenseMemo.Font.Size:=7; - - // Create a custom page to specify comparison programs. - ProgramPage:=CreateInputFilePage( - wpInstalling, - 'Specify comparison programs', - 'One this page you can browse for comparison programs you want meta-diff to launch.', - 'You can skip this step by leaving the boxes blank and editing the ".metadiff" configuration file manually afterwards, which gives you access to more options and examples.' - ); - - ProgramPage.Add( - 'Program to use for directory comparisons:', - 'Executable files (*.exe)|*.exe|All files (*.*)|*.*', - '*.exe' - ); - - ProgramPage.Add( - 'Program to use for file comparisons:', - 'Executable files (*.exe)|*.exe|All files (*.*)|*.*', - '*.exe' - ); end; procedure CurStepChanged(CurStep:TSetupStep); @@ -64,31 +57,60 @@ // ssInstall - Just before the actual installation starts // ssPostInstall - Just after the actual installation finishes // ssDone - Just before Setup terminates after a successful install - if CurStep<>ssDone then begin - Exit; - end; ConfigFile:=ExpandConstant('{userappdata}\.metadiff'); - // Add the programs to the configuration file. - DirProgram:=RemoveQuotes(Trim(ProgramPage.Values[0])); - if Length(DirProgram)>0 then begin - SaveStringToFile(ConfigFile,#13#10+'/ '+DirProgram+#13#10,True); - end; + if CurStep=ssInstall then begin + // Copy any previous configuration files. + ConfigData:=GetPathInstalled('{#emit APP_NAME}'); - FileProgram:=RemoveQuotes(Trim(ProgramPage.Values[1])); - if Length(FileProgram)>0 then begin - SaveStringToFile(ConfigFile,#13#10+'*.* '+FileProgram+#13#10,True); - end; + ConfigExisted:=FileExists(ConfigFile) + or FileCopy(ConfigData+'\.metadiff',ConfigFile,True); + FileCopy(ConfigData+'\.lvdiff',ExpandConstant('{userappdata}\.lvdiff'),True); - // Only add '*.vi ' to the config file if there is no such entry yet. - if LoadStringFromFile(ConfigFile,ConfigData) and (Pos('*.vi ',ConfigData)>0) then begin - Exit; - end; + // Only offer to add programs for newly created config files. + if not ConfigExisted then begin + // Create a custom page to specify comparison programs. + ProgramPage:=CreateInputFilePage( + wpInstalling, + 'Specify comparison programs', + 'One this page you can browse for comparison programs you want meta-diff to launch.', + 'You can skip this step by leaving the boxes blank and editing the ".metadiff" configuration file manually afterwards, which gives you access to more options and examples.' + ); - lvdiff:=ExpandConstant('{app}\lvdiff.exe'); - if FileExists(lvdiff) then begin - SaveStringToFile(ConfigFile,#13#10+'*.vi '+lvdiff+#13#10,True); + ProgramPage.Add( + 'Program to use for directory comparisons:', + 'Executable files (*.exe)|*.exe|All files (*.*)|*.*', + '*.exe' + ); + + ProgramPage.Add( + 'Program to use for file comparisons:', + 'Executable files (*.exe)|*.exe|All files (*.*)|*.*', + '*.exe' + ); + end; + end else if (CurStep=ssDone) and (not ConfigExisted) then begin + // Add the programs to the configuration file. + DirProgram:=RemoveQuotes(Trim(ProgramPage.Values[0])); + if Length(DirProgram)>0 then begin + SaveStringToFile(ConfigFile,#13#10+'/ '+DirProgram+#13#10,True); + end; + + FileProgram:=RemoveQuotes(Trim(ProgramPage.Values[1])); + if Length(FileProgram)>0 then begin + SaveStringToFile(ConfigFile,#13#10+'*.* '+FileProgram+#13#10,True); + end; + + // Only add '*.vi ' to the config file if there is no such entry yet. + if LoadStringFromFile(ConfigFile,ConfigData) and (Pos('*.vi ',ConfigData)>0) then begin + Exit; + end; + + lvdiff:=ExpandConstant('{app}\lvdiff.exe'); + if FileExists(lvdiff) then begin + SaveStringToFile(ConfigFile,#13#10+'*.vi '+lvdiff+#13#10,True); + end; end; end; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |