Resolved issue #505. New installer script based on Inno Setup 5.

--HG--
branch : feature
This commit is contained in:
Holger Pandel 2016-06-10 16:56:35 +02:00
parent 349625fbed
commit 74d47b5a4f
9 changed files with 364 additions and 700 deletions

View File

@ -1,4 +1,5 @@
# Version 0.5.0
- [#505] New installer script based on Inno Setup 5.
- [#508] Settings saved to INI files in different folders.
- [#193] Undeletable zombie arc objects.
- New feature. Groups.

17
dist/win/inno/LICENSE_VALENTINA vendored Normal file
View File

@ -0,0 +1,17 @@
LICENSING
==========
Valentina is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Valentina is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
See LICENSE_GPL.txt file for further information
Other components released under:
* QMuParser - BSD license
* VPropertyExplorer - LGPLv2.1 license

336
dist/win/inno/valentina.iss vendored Normal file
View File

@ -0,0 +1,336 @@
; Script generated by the Inno Script Studio Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "Valentina"
#define MyAppVersion GetFileVersion('valentina\valentina.exe')
#define MyAppPublisher "Roman Telezhynskyi"
#define MyAppURL "http://www.valentina-project.org/"
#define MyAppExeName "valentina.exe"
#define MyAppCopyright "(C) 2013-2015 Valentina project"
#define MyDateTimeString GetDateTimeString('yyyymmddhhnnss', '', '');
; Appstatus: "" = release, "b" = beta, "a" = alpha
; this only modifies the resulting exe name of the installer package ;-)
#define MyAppStatus "a"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{7081AEC7-38FC-479F-B712-DB073BB76512}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppVerName={#MyAppName} {#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
LicenseFile=.\LICENSE_VALENTINA
InfoAfterFile=.\valentina\README.txt
OutputDir=.\
OutputBaseFilename=valentina_{#MyAppVersion}{#MyAppStatus}-{#MyDateTimeString}
SetupIconFile=.\valentina\valentina.ico
Compression=lzma
SolidCompression=yes
VersionInfoVersion={#MyAppVersion}
ShowLanguageDialog=auto
VersionInfoProductName=Valentina
AppCopyright={#MyAppCopyright}
ChangesAssociations=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "armenian"; MessagesFile: "compiler:Languages\Armenian.islu"
Name: "brazilianportuguese"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl"
Name: "catalan"; MessagesFile: "compiler:Languages\Catalan.isl"
Name: "corsican"; MessagesFile: "compiler:Languages\Corsican.isl"
Name: "czech"; MessagesFile: "compiler:Languages\Czech.isl"
Name: "danish"; MessagesFile: "compiler:Languages\Danish.isl"
Name: "dutch"; MessagesFile: "compiler:Languages\Dutch.isl"
Name: "finnish"; MessagesFile: "compiler:Languages\Finnish.isl"
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
Name: "greek"; MessagesFile: "compiler:Languages\Greek.isl"
Name: "hebrew"; MessagesFile: "compiler:Languages\Hebrew.isl"
Name: "hungarian"; MessagesFile: "compiler:Languages\Hungarian.isl"
Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl"
Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl"
Name: "nepali"; MessagesFile: "compiler:Languages\Nepali.islu"
Name: "norwegian"; MessagesFile: "compiler:Languages\Norwegian.isl"
Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl"
Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl"
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
Name: "scottishgaelic"; MessagesFile: "compiler:Languages\ScottishGaelic.isl"
Name: "serbiancyrillic"; MessagesFile: "compiler:Languages\SerbianCyrillic.isl"
Name: "serbianlatin"; MessagesFile: "compiler:Languages\SerbianLatin.isl"
Name: "slovenian"; MessagesFile: "compiler:Languages\Slovenian.isl"
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
Name: "turkish"; MessagesFile: "compiler:Languages\Turkish.isl"
Name: "ukrainian"; MessagesFile: "compiler:Languages\Ukrainian.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1
Name: "fileassoc1"; Description: "{cm:CreateFileAssocVal}"; GroupDescription: "{cm:FileAssoc}"
Name: "fileassoc2"; Description: "{cm:CreateFileAssocVit}"; GroupDescription: "{cm:FileAssoc}"
Name: "fileassoc3"; Description: "{cm:CreateFileAssocVst}"; GroupDescription: "{cm:FileAssoc}"
[Files]
Source: ".\valentina\valentina.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: ".\valentina\tape.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: ".\valentina\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
; DLL used to check if the target program is running at install time
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{group}\Tape"; Filename: "{app}\tape.exe"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{commondesktop}\Tape"; Filename: "{app}\tape.exe"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
[Registry]
Root: "HKCR"; Subkey: ".val"; ValueType: string; ValueName: ""; ValueData: "Valentina.Pattern"; Flags: uninsdeletevalue; Tasks: fileassoc1
Root: "HKCR"; Subkey: ".vit"; ValueType: string; ValueName: ""; ValueData: "Valentina.IndividualMeasurements"; Flags: uninsdeletevalue; Tasks: fileassoc2
Root: "HKCR"; Subkey: ".vst"; ValueType: string; ValueName: ""; ValueData: "Valentina.StandardMeasurements"; Flags: uninsdeletevalue; Tasks: fileassoc3
Root: "HKCR"; Subkey: "Valentina.Pattern"; ValueType: string; ValueData: "Valentina pattern file"; Flags: uninsdeletekey; Tasks: fileassoc1
Root: "HKCR"; Subkey: "Valentina.Pattern\DefaultIcon"; ValueType: string; ValueData: "{app}\valentina.ico,0"; Tasks: fileassoc1
Root: "HKCR"; Subkey: "Valentina.Pattern\shell\open\command"; ValueType: string; ValueData: """{app}\valentina.exe"" ""%1"""; Tasks: fileassoc1
Root: "HKCR"; Subkey: "Valentina.IndividualMeasurements"; ValueType: string; ValueData: "Valentina individual measurement file"; Flags: uninsdeletekey; Tasks: fileassoc2
Root: "HKCR"; Subkey: "Valentina.IndividualMeasurements\DefaultIcon"; ValueType: string; ValueData: "{app}\i-measurements.ico,0"; Tasks: fileassoc2
Root: "HKCR"; Subkey: "Valentina.IndividualMeasurements\shell\open\command"; ValueType: string; ValueData: """{app}\tape.exe"" ""%1"""; Tasks: fileassoc2
Root: "HKCR"; Subkey: "Valentina.StandardMeasurements"; ValueType: string; ValueData: "Valentina standard measurement file"; Flags: uninsdeletekey; Tasks: fileassoc3
Root: "HKCR"; Subkey: "Valentina.StandardMeasurements\DefaultIcon"; ValueType: string; ValueData: "{app}\s-measurements.ico,0"; Tasks: fileassoc3
Root: "HKCR"; Subkey: "Valentina.StandardMeasurements\shell\open\command"; ValueType: string; ValueData: """{app}\tape.exe"" ""%1"""; Tasks: fileassoc3
[CustomMessages]
FileAssoc=Create file associations
CreateFileAssocVal=*.val (Pattern file)
CreateFileAssocVit=*.vit (Individual measurement file)
CreateFileAssocVst=*.vst (Standard measurement file)
WarnRemoveOld= is installed at the moment. Remove old version?
WarnSameVersionExit= is already installed. This installer will exit.
WarnRunningOnUnInstall1= is currently running.
WarnRunningOnUnInstall2=Please close it and then click on ''Retry'' to proceed.
WarnCancelInstall=The installation was canceled.
WarnCancelUninstall=The uninstallation process was canceled.
WarnOverwrite= is already installed. Overwrite existing installation?
SetupIsRunningWarning = Valentina setup is already running!
DeinstIsRunningWarning = Valentina uninstall is already running!
[Code]
const
// Executable names to check before any setup/uninstall operation
ProgramName1 = 'Valentina';
ProgramExeName1 = 'valentina.exe';
ProgramName2 = 'Tape';
ProgramExeName2 = 'tape.exe';
/////////////////////////////////////////////////////////////////////
// Convert version strings into float and compare
// easier than string comparison
function CompareVersion(str1, str2: String): Integer;
var
temp1, temp2: String;
num1, num2 : Variant;
begin
temp1 := str1;
temp2 := str2;
StringChangeEx(temp1, '.', '', True);
StringChangeEx(temp2, '.', '', True);
num1 := 100*StrToFloat(temp1);
num2 := 100*StrToFloat(temp2);
Result := num1 - num2
end;
// Global variables/constants and general functions
const installer_mutex_name = '{#MyAppName}' + '_setup_mutex';
const uninstaller_mutex_name = '{#MyAppName}' + '_uninstall_mutex';
/////////////////////////////////////////////////////////////////////
// Find application by name in current process list
// -> AppName: Name of running exe file
// <- True if the program found, False if not
function FindApp(const AppName: String): Boolean;
var
WMIService: Variant;
WbemLocator: Variant;
WbemObjectSet: Variant;
begin
WbemLocator := CreateOleObject('WbemScripting.SWbemLocator');
WMIService := WbemLocator.ConnectServer('localhost', 'root\CIMV2');
WbemObjectSet := WMIService.ExecQuery('SELECT * FROM Win32_Process Where Name="' + AppName + '"');
if not VarIsNull(WbemObjectSet) and (WbemObjectSet.Count > 0) then
begin
Result := True;
end
else begin
Result := False;
end;
end;
/////////////////////////////////////////////////////////////////////
// Prompt the user to close a program that's still running.
// Finish when the executable is closed or the user cancels the process.
// -> ProgramExeName: Name of executable
// -> Message : User message to prompt to close
// <- True if the program was closed (or was not running),
// False if the user clicked on the Cancel button and didn't close the program
function PromptUntilProgramClosedOrInstallationCanceled(
ProgramExeName: String;
Message: String ): Boolean;
var
ButtonPressed : Integer;
begin
ButtonPressed := IDRETRY;
// Check if the program is running or if the user has pressed the cancel button
while FindApp( ProgramExeName ) and ( ButtonPressed <> IDCANCEL ) do
begin
ButtonPressed := MsgBox( message , mbError, MB_RETRYCANCEL );
end;
// Has the program been closed?
Result := Not FindApp( ProgramExeName );
end;
/////////////////////////////////////////////////////////////////////
// Version comparison on installation
function VersionCompareAndUninstall(): Boolean;
var
oldVersion: String;
uninstaller: String;
ErrorCode: Integer;
tmpId : String;
begin
tmpId := '{#emit SetupSetting("AppId")}';
Delete(tmpId,1,1);
if RegKeyExists(HKEY_LOCAL_MACHINE,
'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\' + tmpId + '_is1') then
begin
RegQueryStringValue(HKEY_LOCAL_MACHINE,
'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\' + tmpId + '_is1',
'DisplayVersion', oldVersion);
if (CompareVersion(oldVersion, '{#emit SetupSetting("AppVersion")}') < 0) then
begin
if MsgBox('Version ' + oldVersion + ExpandConstant('{cm:WarnRemoveOld}'),
mbConfirmation, MB_YESNO) = IDNO then
begin
Result := False;
end
else
begin
RegQueryStringValue(HKEY_LOCAL_MACHINE,'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\' + tmpId + '_is1','UninstallString', uninstaller);
If ShellExec('', uninstaller, '/SILENT', '', SW_SHOW, ewWaitUntilTerminated, ErrorCode) then
begin
// handle success if necessary; ResultCode contains the exit code
Result := True
end
else begin
// handle failure if necessary; ResultCode contains the error code
Result := False
end
end;
end
else
begin
//MsgBox('Version ' + oldVersion + ExpandConstant('{cm:WarnSameVersionExit}'),mbInformation, MB_OK);
if MsgBox('Version ' + oldVersion + ExpandConstant('{cm:WarnOverwrite}'),
mbConfirmation, MB_YESNO) = IDNO then
Result := False
else
Result := True;
end;
end
else
begin
Result := True;
end;
end;
/////////////////////////////////////////////////////////////////////
// Run on setup
function InitializeSetup(): Boolean;
var
// User messages
ProgramRunningOnInstallMessage : String;
InstallationCanceledMessage : String;
begin
// Create a mutex for the installer and if it's already running then show a message and stop installation
if CheckForMutexes(installer_mutex_name) then begin
SuppressibleMsgBox(ExpandConstant('{cm:SetupIsRunningWarning}'), mbError, MB_OK, MB_OK);
Result := False;
end
else begin
Result := True;
CreateMutex(installer_mutex_name);
ProgramRunningOnInstallMessage := ExpandConstant('{cm:WarnRunningOnUnInstall1}') + #13 + #13 + ExpandConstant('{cm:WarnRunningOnUnInstall2}');
InstallationCanceledMessage := ExpandConstant('{cm:WarnCancelInstall}');
Result := PromptUntilProgramClosedOrInstallationCanceled( ProgramExeName1, ProgramName1 + ProgramRunningOnInstallMessage)
If Result Then
begin
Result := PromptUntilProgramClosedOrInstallationCanceled( ProgramExeName2, ProgramName2 + ProgramRunningOnInstallMessage)
end;
if Not Result then
begin
MsgBox( InstallationCanceledMessage, mbInformation, MB_OK );
end else begin
Result := VersionCompareAndUninstall
end;
end;
end;
/////////////////////////////////////////////////////////////////////
// Run on uninstall
function InitializeUninstall(): Boolean;
var
// User message
ProgramRunningOnUninstallMessage : String;
UninstallationCanceledMessage : String;
begin
if CheckForMutexes(uninstaller_mutex_name) then begin
SuppressibleMsgBox(ExpandConstant('{cm:DeinstIsRunningWarning}'), mbError, MB_OK, MB_OK);
Result := False;
end else
begin
Result := True;
CreateMutex(uninstaller_mutex_name);
ProgramRunningOnUninstallMessage := ExpandConstant('{cm:WarnRunningOnUnInstall1}') + #13 + #13 + ExpandConstant('{cm:WarnRunningOnUnInstall2}');
UninstallationCanceledMessage := ExpandConstant('{cm:WarnCancelUninstall}');
Result := PromptUntilProgramClosedOrInstallationCanceled( ProgramExeName1, ProgramName1 + ProgramRunningOnUninstallMessage);
If Result Then
begin
Result := PromptUntilProgramClosedOrInstallationCanceled( ProgramExeName2, ProgramName2 + ProgramRunningOnUninstallMessage);
end;
if not Result then
begin
MsgBox( UninstallationCanceledMessage, mbInformation, MB_OK );
end;
end;
end;

View File

@ -1,152 +0,0 @@
; fileassoc.nsh
; File association helper macros
; Written by Saivert
; Adaptation for Windows Vista and higher by Roman Telezhynskyi
;
; Features automatic backup system and UPDATEFILEASSOC macro for
; shell change notification.
;
; |> How to use <|
; To associate a file with an application so you can double-click it in explorer, use
; the APP_ASSOCIATE macro like this:
;
; Example:
; !insertmacro APP_ASSOCIATE "txt" "myapp.textfile" "text/plain" \
; "Description of txt files" "$INSTDIR\myapp.exe,0" "Open with myapp" \
; "$INSTDIR\myapp.exe $\"%1$\""
;
; Never insert the APP_ASSOCIATE macro multiple times, it is only ment
; to associate an application with a single file and using the
; the "open" verb as default. To add more verbs (actions) to a file
; use the APP_ASSOCIATE_ADDVERB macro.
;
; Example:
; !insertmacro APP_ASSOCIATE_ADDVERB "myapp.textfile" "edit" "text/plain" \
; "Edit with myapp" "$INSTDIR\myapp.exe /edit $\"%1$\""
;
; To have access to more options when registering the file association use the
; APP_ASSOCIATE_EX macro. Here you can specify the verb and what verb is to be the
; standard action (default verb).
;
; And finally: To remove the association from the registry use the APP_UNASSOCIATE
; macro. Here is another example just to wrap it up:
; !insertmacro APP_UNASSOCIATE "txt" "myapp.textfile"
;
; |> Note <|
; When defining your file class string always use the short form of your application title
; then a period (dot) and the type of file. This keeps the file class sort of unique.
; Examples:
; Winamp.File
; Winamp.Playlist
; NSIS.Script
; Photoshop.JPEGFile
;
; |> Tech info <|
; The registry key layout for a file association is:
;HKEY_LOCAL_MACHINE
; Software
; Classes
; .mp3
; (default)=Winamp.File
; Winamp.File
; (default)=Winamp Media File
; DefaultIcon
; (default)=c:\program files\winamp\winamp.exe,1
; shell
; Play=&Play in Winamp
; command
; (default)="c:\program files\winamp\winamp.exe" "%1$"
; Open
; command
; (default)="c:\program files\winamp\winamp.exe" "%1$"
; ListBookmark
; (default)=Add to Winamp's &Bookmark list
; command
; (default)="c:\program files\winamp\winamp.exe"/BOOKMARK "%1$"
; Enqueue
; (default)=&Enqueue in Winamp
; command
; (default)="c:\program files\winamp\winamp.exe$"/ADD "%1$"
!macro APP_ASSOCIATE EXT FILECLASS MIME DESCRIPTION ICON COMMANDTEXT COMMAND
; Backup the previously associated file class
ReadRegStr $R0 HKCU "Software\Classes\.${EXT}" ""
WriteRegStr HKCU "Software\Classes\.${EXT}" "${FILECLASS}_backup" "$R0"
WriteRegStr HKCU "Software\Classes\.${EXT}" "" "${FILECLASS}"
WriteRegStr HKCU "Software\Classes\.${EXT}" "Content Type" "${MIME}"
WriteRegStr HKCU "Software\Classes\.${EXT}\OpenWithProgIds" "${FILECLASS}" ""
WriteRegStr HKCU "Software\Classes\${FILECLASS}" "" "${DESCRIPTION}"
WriteRegStr HKCU "Software\Classes\${FILECLASS}\DefaultIcon" "" "${ICON}"
WriteRegStr HKCU "Software\Classes\${FILECLASS}\shell" "" "open"
WriteRegStr HKCU "Software\Classes\${FILECLASS}\shell\open" "" "${COMMANDTEXT}"
WriteRegStr HKCU "Software\Classes\${FILECLASS}\shell\open\command" "" "${COMMAND}"
; Set application by default for current user (since Windows Vista)
; Backup the previously choice
ReadRegStr $R0 HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.${EXT}\UserChoice" ""
WriteRegStr HKCU "Software\Classes\.${EXT}" "UserChoice_backup" "$R0"
DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.${EXT}\UserChoice"
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.${EXT}\UserChoice" "Progid" "${FILECLASS}"
!macroend
!macro APP_ASSOCIATE_EX EXT FILECLASS MIME DESCRIPTION ICON VERB DEFAULTVERB SHELLNEW COMMANDTEXT COMMAND
; Backup the previously associated file class
ReadRegStr $R0 HKCU "Software\Classes\.${EXT}" ""
WriteRegStr HKCU "Software\Classes\.${EXT}" "${FILECLASS}_backup" "$R0"
WriteRegStr HKCU "Software\Classes\.${EXT}" "" "${FILECLASS}"
WriteRegStr HKCU "Software\Classes\.${EXT}" "Content Type" "${MIME}"
WriteRegStr HKCU "Software\Classes\.${EXT}\OpenWithProgIds" "${FILECLASS}" ""
StrCmp "${SHELLNEW}" "0" +2
WriteRegStr HKCU "Software\Classes\.${EXT}\ShellNew" "NullFile" ""
WriteRegStr HKCU "Software\Classes\${FILECLASS}" "" "${DESCRIPTION}"
WriteRegStr HKCU "Software\Classes\${FILECLASS}\DefaultIcon" "" "${ICON}"
WriteRegStr HKCU "Software\Classes\${FILECLASS}\shell" "" "${DEFAULTVERB}"
WriteRegStr HKCU "Software\Classes\${FILECLASS}\shell\${VERB}" "" "${COMMANDTEXT}"
WriteRegStr HKCU "Software\Classes\${FILECLASS}\shell\${VERB}\command" "" "${COMMAND}"
!macroend
!macro APP_ASSOCIATE_ADDVERB FILECLASS VERB COMMANDTEXT COMMAND
WriteRegStr HKCU "Software\Classes\${FILECLASS}\shell\${VERB}" "" "${COMMANDTEXT}"
WriteRegStr HKCU "Software\Classes\${FILECLASS}\shell\${VERB}\command" "" "${COMMAND}"
!macroend
!macro APP_ASSOCIATE_REMOVEVERB FILECLASS VERB
DeleteRegKey HKCR "Software\Classes\${FILECLASS}\shell\${VERB}"
!macroend
!macro APP_UNASSOCIATE EXT FILECLASS
; Backup the previously associated file class
ReadRegStr $R0 HKCU "Software\Classes\.${EXT}" "${FILECLASS}_backup"
WriteRegStr HKCU "Software\Classes\.${EXT}" "" "$R0"
DeleteRegValue HKCU "Software\Classes\.${EXT}" "${FILECLASS}_backup"
DeleteRegKey HKCU "Software\Classes\${FILECLASS}"
; Backup application by default for current user
ReadRegStr $R0 HKCU "Software\Classes\.${EXT}" "UserChoice_backup"
DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.${EXT}\UserChoice"
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.${EXT}\UserChoice" "Progid" "$R0"
DeleteRegValue HKCU "Software\Classes\.${EXT}" "UserChoice_backup"
!macroend
; !defines for use with SHChangeNotify
!ifdef SHCNE_ASSOCCHANGED
!undef SHCNE_ASSOCCHANGED
!endif
!define SHCNE_ASSOCCHANGED 0x08000000
!ifdef SHCNF_FLUSH
!undef SHCNF_FLUSH
!endif
!define SHCNF_FLUSH 0x1000
!macro UPDATEFILEASSOC
; Using the system.dll plugin to call the SHChangeNotify Win32 API function so we
; can update the shell.
System::Call "shell32::SHChangeNotify(i,i,i,i) (${SHCNE_ASSOCCHANGED}, ${SHCNF_FLUSH}, 0, 0)"
!macroend
;EOF

View File

@ -1,30 +0,0 @@
; fileversion.nsh
; Source http://nsis.sourceforge.net/GetDLLVersionLocal_as_define
;
; GetDLLVersionLocal only gives you two packed 32bit numbers, but
; sometimes you might need the unpacked numbers at compile time. This is
; where this ugly thing comes in.
;
; Example usage
; !insertmacro GetPEVersionLocal "$%windir%\system32\kernel32.dll" myver
; Outfile "$%temp%\hello ${myver_1}.${myver_2}.${myver_3}.${myver_4}.exe"
!macro GetPEVersionLocal file defbase
!verbose push
!verbose 2
!tempfile GetPEVersionLocal_nsi
!tempfile GetPEVersionLocal_exe
!define GetPEVersionLocal_doll "$"
!appendfile "${GetPEVersionLocal_nsi}" 'SilentInstall silent$\nRequestExecutionLevel user$\nOutFile "${GetPEVersionLocal_exe}"$\nPage instfiles$\nSection'
!appendfile "${GetPEVersionLocal_nsi}" '$\nFileOpen $0 "${GetPEVersionLocal_nsi}" w$\nGetDllVersion "${file}" $R0 $R1$\nIntOp $R2 $R0 / 0x00010000$\nIntOp $R3 $R0 & 0x0000FFFF$\nIntOp $R4 $R1 / 0x00010000$\nIntOp $R5 $R1 & 0x0000FFFF'
!appendfile "${GetPEVersionLocal_nsi}" '$\nFileWrite $0 "!define ${defbase}_1 $R2${GetPEVersionLocal_doll}\n"$\nFileWrite $0 "!define ${defbase}_2 $R3${GetPEVersionLocal_doll}\n"$\nFileWrite $0 "!define ${defbase}_3 $R4${GetPEVersionLocal_doll}\n"$\nFileWrite $0 "!define ${defbase}_4 $R5${GetPEVersionLocal_doll}\n"$\nFileClose $0$\nSectionEnd'
!system '"${NSISDIR}\makensis" /V2 "${GetPEVersionLocal_nsi}"' = 0
!system '"${GetPEVersionLocal_exe}"' = 0
!include "${GetPEVersionLocal_nsi}"
!delfile "${GetPEVersionLocal_nsi}"
!delfile "${GetPEVersionLocal_exe}"
!undef GetPEVersionLocal_nsi
!undef GetPEVersionLocal_exe
!undef GetPEVersionLocal_doll
!verbose pop
!macroend

Binary file not shown.

View File

@ -1,220 +0,0 @@
;-----------------------------------------------------------------------------------------------
; Generate list of files and directories for uninstaller with command line support (/? for help)
; Create installer and use like external program that generate list of files.
;
; 2006 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)
;-----------------------------------------------------------------------------------------------
; - added file filter as command option
; 2005 Patrick Graf (patrick.graf@gmx.net)
;-----------------------------------------------------------------------------------------------
; - combine unList and unListDate to one script
; 2005 Matei "Ambient.Impact" Stanca (ambient.impact@rogers.com)
;-----------------------------------------------------------------------------------------------
Name "unList v1.5"
OutFile "unList.exe"
Caption "$(^Name)"
SubCaption 2 " "
SubCaption 3 " "
!include "FileFunc.nsh"
!insertmacro GetTime
!insertmacro GetParameters
!insertmacro GetOptions
!insertmacro GetExePath
!include "TextFunc.nsh"
!insertmacro FileReadFromEnd
!insertmacro FileJoin
!insertmacro TrimNewLines
!include "Sections.nsh"
Var DATE
Var FILEFILTER
Var LOG
Var PREFIX
Var UNDIR_VAR
Var MB
Var RADIOBUTTON
DirText '$\nSetup will generate list of files and directories for uninstaller.'\
'Source Folder'
Page directory
Page components
Page instfiles
Section "unList" unList
StrCpy $DATE '0'
call main
SectionEnd
Section /o "unListDate" unListDate
StrCpy $DATE '1'
call main
SectionEnd
Function .onSelChange
!insertmacro StartRadioButtons $RADIOBUTTON
!insertmacro RadioButton ${unList}
!insertmacro RadioButton ${unListDate}
!insertmacro EndRadioButtons
FunctionEnd
Function .onInit
StrCpy $RADIOBUTTON ${unList}
${GetExePath} $EXEDIR
${GetParameters} $R0
StrCmp $R0 '/?' +2
StrCmp $R0 '-?' 0 GetOptions
MessageBox MB_OK \
`| Command line options:$\n\
| $\n\
| /DATE=[0|1] Only files not modified after installation are deleted$\n\
| default: 0$\n\
| /INSTDIR=[path] Get file list from this path$\n\
| default: [exe directory]$\n\
| /FILTER=[*.*] Only files matching the given filter are added$\n\
| default: *.*$\n\
| /LOG=[file] Ouput file list$\n\
| default: unList.txt$\n\
| /PREFIX=[text] Insert text (spaces) at the beginning$\n\
| default: empty$\n\
| /UNDIR_VAR=[$$var] Uninstall directory variable$\n\
| default: $$INSTDIR$\n\
| /MB=[1|0] Show or not MessageBoxes$\n\
| default: 1$\n\
$\n\
$\n\
Example:$\n\
unList.exe /DATE=1 /INSTDIR=C:\a /LOG=C:\a.log /PREFIX=" " /UNDIR_VAR=$$R0`
quit
GetOptions:
${GetOptions} '$R0' '/DATE=' $R1
StrCmp $R1 '' 0 +3
StrCpy $DATE '0'
Goto +2
StrCpy $DATE $R1
${GetOptions} '$R0' '/INSTDIR=' $R1
StrCmp $R1 '' 0 +3
StrCpy $INSTDIR '$EXEDIR'
goto +2
StrCpy $INSTDIR $R1
${GetOptions} '$R0' '/FILTER=' $R1
StrCmp $R1 '' 0 +3
StrCpy $FILEFILTER '*.*'
goto +2
StrCpy $FILEFILTER $R1
${GetOptions} '$R0' '/LOG=' $R1
StrCmp $R1 '' 0 +3
StrCpy $LOG 'unList.txt'
goto +2
StrCpy $LOG $R1
${GetOptions} '$R0' '/PREFIX=' $R1
StrCmp $R1 '' 0 +3
StrCpy $PREFIX ''
goto +2
StrCpy $PREFIX $R1
${GetOptions} '$R0' '/UNDIR_VAR=' $R1
StrCmp $R1 '' 0 +3
StrCpy $UNDIR_VAR '$$INSTDIR'
goto +2
StrCpy $UNDIR_VAR $R1
${GetOptions} '$R0' '/MB=' $R1
StrCmp $R1 '' 0 +3
StrCpy $MB '1'
goto +2
StrCpy $MB $R1
StrCmp $R0 '' +2
call main
FunctionEnd
Function main
ClearErrors
SearchPath $INSTDIR $INSTDIR
IfErrors error
StrLen $R5 $INSTDIR
IntOp $R5 $R5 + 1
InitPluginsDir
GetTempFileName $R1 $PLUGINSDIR
GetTempFileName $R2 $PLUGINSDIR
GetTempFileName $R3 $PLUGINSDIR
ExpandEnvStrings $R0 %COMSPEC%
nsExec::Exec '"$R0" /C DIR "$INSTDIR\$FILEFILTER" /A-D /B /S /ON>"$R1"'
FileOpen $R4 $R2 w
${FileReadFromEnd} '$R1' FilesCallback
FileClose $R4
nsExec::Exec '"$R0" /C DIR "$INSTDIR\*.*" /AD /B /S /ON>"$R1"'
FileOpen $R4 $R3 w
${FileReadFromEnd} '$R1' DirectoriesCallback
FileClose $R4
${FileJoin} '$R2' '$R3' '$R2'
Delete '$EXEDIR\$LOG'
Rename $R2 '$EXEDIR\$LOG'
IfErrors 0 success
Delete $LOG
Rename $R2 $LOG
IfErrors 0 success
error:
StrCmp $MB 0 quit
HideWindow
MessageBox MB_OK|MB_ICONEXCLAMATION 'error'
quit
success:
StrCmp $MB 0 quit
HideWindow
MessageBox MB_OK|MB_ICONINFORMATION '"$LOG" was successfully generated'
quit:
quit
FunctionEnd
Function FilesCallback
System::Call 'user32::OemToChar(t r9, t .r9)'
${TrimNewLines} '$9' $9
StrCmp $DATE '0' 0 unListDate
StrCpy $9 $9 '' $R5
FileWrite $R4 `$PREFIXDelete "$UNDIR_VAR\$9"$\r$\n`
goto end
unListDate:
${GetTime} '$9' 'M' $0 $1 $2 $3 $4 $5 $6
StrCpy $3 '$${'
StrCpy $9 $9 '' $R5
FileWrite $R4 `$PREFIX$3un.GetTime} "$UNDIR_VAR\$9" "M" $$0 $$1 $$2 $$3 $$4 $$5 $$6$\r$\n`
FileWrite $R4 `$PREFIXIfErrors +5$\r$\n`
FileWrite $R4 `$PREFIXStrCmp "$$0/$$1/$$2-$$4:$$5:$$6" "$0/$1/$2-$4:$5:$6" 0 +3$\r$\n`
FileWrite $R4 `$PREFIXDelete "$UNDIR_VAR\$9"$\r$\n`
FileWrite $R4 `$PREFIXgoto +2$\r$\n`
FileWrite $R4 `$PREFIXDetailPrint "Not deleted: $UNDIR_VAR\$9"$\r$\n$\r$\n`
end:
Push 0
FunctionEnd
Function DirectoriesCallback
System::Call 'user32::OemToChar(t r9, t .r9)'
${TrimNewLines} '$9' $9
StrCpy $9 $9 '' $R5
FileWrite $R4 `$PREFIXRMDir "$UNDIR_VAR\$9"$\r$\n`
Push 0
FunctionEnd

View File

@ -1,282 +0,0 @@
; NSIS installer script for Valentina
; --------------- Headers --------------
!include "MUI2.nsh"
!include "headers\fileassoc.nsh"
!include "headers\fileversion.nsh"
!include "FileFunc.nsh"
; --------------- General --------------
CRCCheck force
XPStyle on
SetCompressor /FINAL /SOLID lzma
!insertmacro un.GetTime
!define PACKAGE_FOLDER "valentina"
!define PRODUCT_VALENTINA "Valentina"
!define FILE_VALENTINA "valentina"
!define PRODUCT_TAPE "Tape"
!define FILE_TAPE "tape"
!insertmacro GetPEVersionLocal "${PACKAGE_FOLDER}\${FILE_VALENTINA}.exe" ver
!define MUI_VERSION "${ver_1}.${ver_2}.${ver_3}a" ; Delete "a" before release
!define MUI_BRANDINGTEXT "${PRODUCT_VALENTINA} ${MUI_VERSION}"
!define WEBSITE_LINK "http://www.valentina-project.org/"
!define PUBLISHER "Roman Telezhynskyi"
InstallDir "$LOCALAPPDATA\${PRODUCT_VALENTINA}" ; Default installation folder
Name "${MUI_BRANDINGTEXT}" ; Name displayed on installer
Icon "${PACKAGE_FOLDER}\${FILE_VALENTINA}.ico"
Caption "${MUI_BRANDINGTEXT}"
!define /date MYTIMESTAMP "%Y%m%d%H%M%S"
OutFile "${FILE_VALENTINA}_${MUI_VERSION}-${MYTIMESTAMP}_i386.exe" ; Resulting installer filename
InstallDirRegKey HKCU "$LOCALAPPDATA\${PRODUCT_VALENTINA}" "" ; Get installation folder from registry if available
LicenseData "${PACKAGE_FOLDER}\LICENSE_GPL.txt"
RequestExecutionLevel user ; Request application privileges for Windows Vista
ShowInstDetails show
ShowUninstDetails show
; ----------- Icon and Bitmap ---------
!define MUI_ICON "${PACKAGE_FOLDER}\${FILE_VALENTINA}.ico"
!define MUI_UNICON "${PACKAGE_FOLDER}\${FILE_VALENTINA}.ico"
;!define MUI_SPECIALBITMAP "Bitmap.bmp"
; -------------------------------------
!define MUI_ABORTWARNING
;------------- Language Selection Dialog Settings --------------
;Remember the installer language
!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
!define MUI_LANGDLL_REGISTRY_KEY "Software\${PRODUCT_VALENTINA}"
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
!define REG_UNINSTALL "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_VALENTINA}"
!define REGISTRY_ROOT "HKCU"
;-------------- Install Pages -------------
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "${PACKAGE_FOLDER}\LICENSE_GPL.txt"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
; These indented statements modify settings for MUI_PAGE_FINISH
!define MUI_FINISHPAGE_NOAUTOCLOSE
!define MUI_FINISHPAGE_RUN "$INSTDIR\${FILE_VALENTINA}.exe"
!define MUI_FINISHPAGE_RUN_CHECKED
!define MUI_FINISHPAGE_RUN_TEXT "Launch ${PRODUCT_VALENTINA}"
!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\README.txt"
!insertmacro MUI_PAGE_FINISH
;-------------- Uninstall Pages -------------
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
; These indented statements modify settings for MUI_UNPAGE_FINISH
!define MUI_UNFINISHPAGE_NOAUTOCLOSE
!insertmacro MUI_UNPAGE_FINISH
;--------------- Languages ---------------
!define MUI_LANGDLL_ALLLANGUAGES
!insertmacro MUI_LANGUAGE "English" ;first language is the default language
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "Russian"
!insertmacro MUI_LANGUAGE "Ukrainian"
!insertmacro MUI_LANGUAGE "Czech"
!insertmacro MUI_LANGUAGE "Hebrew"
!insertmacro MUI_LANGUAGE "Italian"
!insertmacro MUI_LANGUAGE "Dutch"
!insertmacro MUI_LANGUAGE "Spanish"
!insertmacro MUI_LANGUAGE "SpanishInternational"
!insertmacro MUI_LANGUAGE "SimpChinese"
!insertmacro MUI_LANGUAGE "TradChinese"
!insertmacro MUI_LANGUAGE "Japanese"
!insertmacro MUI_LANGUAGE "Korean"
!insertmacro MUI_LANGUAGE "Danish"
!insertmacro MUI_LANGUAGE "Swedish"
!insertmacro MUI_LANGUAGE "Norwegian"
!insertmacro MUI_LANGUAGE "NorwegianNynorsk"
!insertmacro MUI_LANGUAGE "Finnish"
!insertmacro MUI_LANGUAGE "Greek"
!insertmacro MUI_LANGUAGE "Portuguese"
!insertmacro MUI_LANGUAGE "PortugueseBR"
!insertmacro MUI_LANGUAGE "Polish"
!insertmacro MUI_LANGUAGE "Slovak"
!insertmacro MUI_LANGUAGE "Croatian"
!insertmacro MUI_LANGUAGE "Bulgarian"
!insertmacro MUI_LANGUAGE "Hungarian"
!insertmacro MUI_LANGUAGE "Thai"
!insertmacro MUI_LANGUAGE "Romanian"
!insertmacro MUI_LANGUAGE "Latvian"
!insertmacro MUI_LANGUAGE "Macedonian"
!insertmacro MUI_LANGUAGE "Estonian"
!insertmacro MUI_LANGUAGE "Turkish"
!insertmacro MUI_LANGUAGE "Lithuanian"
!insertmacro MUI_LANGUAGE "Slovenian"
!insertmacro MUI_LANGUAGE "Serbian"
!insertmacro MUI_LANGUAGE "SerbianLatin"
!insertmacro MUI_LANGUAGE "Arabic"
!insertmacro MUI_LANGUAGE "Farsi"
!insertmacro MUI_LANGUAGE "Indonesian"
!insertmacro MUI_LANGUAGE "Mongolian"
!insertmacro MUI_LANGUAGE "Luxembourgish"
!insertmacro MUI_LANGUAGE "Albanian"
!insertmacro MUI_LANGUAGE "Breton"
!insertmacro MUI_LANGUAGE "Belarusian"
!insertmacro MUI_LANGUAGE "Icelandic"
!insertmacro MUI_LANGUAGE "Malay"
!insertmacro MUI_LANGUAGE "Bosnian"
!insertmacro MUI_LANGUAGE "Kurdish"
!insertmacro MUI_LANGUAGE "Irish"
!insertmacro MUI_LANGUAGE "Uzbek"
!insertmacro MUI_LANGUAGE "Galician"
!insertmacro MUI_LANGUAGE "Afrikaans"
!insertmacro MUI_LANGUAGE "Catalan"
!insertmacro MUI_LANGUAGE "Esperanto"
; ------------- Reserve Files ---------------------
;If you are using solid compression, files that are required before
;the actual installation should be stored first in the data block,
;because this will make your installer start faster.
!insertmacro MUI_RESERVEFILE_LANGDLL
; ------------- Installer Functions ---------------
Function checkAlreadyInstalled
; check for already installed instance
ClearErrors
ReadRegStr $R0 "${REGISTRY_ROOT}" "${REG_UNINSTALL}" "UninstallString"
StrCmp $R0 "" done
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
"${PRODUCT_VALENTINA} is already installed. $\n$\nClick `OK` to remove the \
previous version or `Cancel` to cancel this upgrade." \
IDOK UnInstall
Abort
;Run the uninstaller
UnInstall:
ClearErrors
ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
;uninstall.exe is still here
;Delete Files
RMDir /r "$INSTDIR\*.*"
;Remove the installation directory
RMDir "$INSTDIR"
IfErrors no_remove_uninstaller done
;You can either use Delete /REBOOTOK in the uninstaller or add some code
;here to remove the uninstaller. Use a registry key to check
;whether the user has chosen to uninstall. If you are using an uninstaller
;components page, make sure all sections are uninstalled.
no_remove_uninstaller:
MessageBox MB_OK|MB_ICONSTOP "Error while uninstalling \
previously installed version. Please uninstall it manually \
and start the installer again."
Quit
done:
FunctionEnd
Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY ;This has to come after the language macros
Call checkAlreadyInstalled
FunctionEnd
;-------------- Uninstaller Functions -------------
Function un.onInit
!insertmacro MUI_UNGETLANGUAGE
FunctionEnd
;-------------- Installer -------------------------
Section
;Add files
SetOutPath "$INSTDIR" ; Set output path to the installation directory.
File /r "${PACKAGE_FOLDER}\*.*"
;create start-menu items
!define START_LINK_DIR "$SMPROGRAMS\${PRODUCT_VALENTINA}"
!define START_LINK_RUN "$SMPROGRAMS\${PRODUCT_VALENTINA}\${PRODUCT_VALENTINA}.lnk"
!define START_LINK_RUN_TAPE "$SMPROGRAMS\${PRODUCT_VALENTINA}\${PRODUCT_TAPE}.lnk"
!define START_LINK_UNINSTALLER "$SMPROGRAMS\${PRODUCT_VALENTINA}\Uninstall ${PRODUCT_VALENTINA}.lnk"
# In your main installer section...
SetShellVarContext current
CreateDirectory "${START_LINK_DIR}"
CreateShortCut "${START_LINK_RUN}" "$INSTDIR\${FILE_VALENTINA}.exe"
CreateShortCut "${START_LINK_RUN_TAPE}" "$INSTDIR\${FILE_TAPE}.exe"
CreateShortCut "${START_LINK_UNINSTALLER}" "$INSTDIR\Uninstall.exe"
;create desktop shortcut
CreateShortCut "$DESKTOP\${PRODUCT_VALENTINA}.lnk" "$INSTDIR\${FILE_VALENTINA}.exe" ""
CreateShortCut "$DESKTOP\${PRODUCT_TAPE}.lnk" "$INSTDIR\${FILE_TAPE}.exe" ""
;write uninstall information to the registry
!define UNINSTALLER_NAME "Uninstall.exe"
; File associations
; Valentina
!insertmacro APP_ASSOCIATE "val" "valentina.pattern" "text/plain" "${PRODUCT_VALENTINA} pattern file" "$INSTDIR\pattern.ico" "Open with ${PRODUCT_VALENTINA}" "$INSTDIR\${FILE_VALENTINA}.exe $\"%1$\""
; Tape
!insertmacro APP_ASSOCIATE "vit" "valentina.IndividualMeasurements" "text/plain" "${PRODUCT_VALENTINA} individual measurement file" "$INSTDIR\i-measurements.ico" "Open with ${PRODUCT_TAPE}" "$INSTDIR\${FILE_TAPE}.exe $\"%1$\""
!insertmacro APP_ASSOCIATE "vst" "valentina.StandardMeasurements" "text/plain" "${PRODUCT_VALENTINA} standard measurement file" "$INSTDIR\s-measurements.ico" "Open with ${PRODUCT_TAPE}" "$INSTDIR\${FILE_TAPE}.exe $\"%1$\""
!insertmacro UPDATEFILEASSOC
WriteRegStr "${REGISTRY_ROOT}" "${REG_UNINSTALL}" "DisplayName" "${PRODUCT_VALENTINA}"
WriteRegStr "${REGISTRY_ROOT}" "${REG_UNINSTALL}" "DisplayIcon" "$\"$INSTDIR\${FILE_VALENTINA}.exe$\""
WriteRegStr "${REGISTRY_ROOT}" "${REG_UNINSTALL}" "Publisher" "${PUBLISHER}"
WriteRegStr "${REGISTRY_ROOT}" "${REG_UNINSTALL}" "DisplayVersion" "${MUI_VERSION}"
; Run GetSize after coping all files
${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
IntFmt $0 "0x%08X" $0
WriteRegDWord "${REGISTRY_ROOT}" "${REG_UNINSTALL}" "EstimatedSize" "$0"
WriteRegStr "${REGISTRY_ROOT}" "${REG_UNINSTALL}" "HelpLink" "${WEBSITE_LINK}"
WriteRegStr "${REGISTRY_ROOT}" "${REG_UNINSTALL}" "URLInfoAbout" "${WEBSITE_LINK}"
WriteRegStr "${REGISTRY_ROOT}" "${REG_UNINSTALL}" "InstallLocation" "$\"$INSTDIR$\""
WriteRegStr "${REGISTRY_ROOT}" "${REG_UNINSTALL}" "InstallSource" "$\"$EXEDIR$\""
WriteRegDWord "${REGISTRY_ROOT}" "${REG_UNINSTALL}" "NoModify" 1
WriteRegDWord "${REGISTRY_ROOT}" "${REG_UNINSTALL}" "NoRepair" 1
WriteRegStr "${REGISTRY_ROOT}" "${REG_UNINSTALL}" "UninstallString" "$\"$INSTDIR\${UNINSTALLER_NAME}$\""
WriteRegStr "${REGISTRY_ROOT}" "${REG_UNINSTALL}" "Comments" "Uninstalls ${PRODUCT_VALENTINA}."
WriteUninstaller "$INSTDIR\${UNINSTALLER_NAME}" ; Location of the uninstaller
SectionEnd
;--------------------------------
;Uninstaller Section
Section "Uninstall"
;Generate list and include it in script at compile-time
!execute 'unList.exe /DATE=0 /INSTDIR=${PACKAGE_FOLDER} /LOG=Test.log /PREFIX=" " /UNDIR_VAR=$INSTDIR /MB=0'
;Log contain commands for removing files
!include "Test.log"
;Delete Start Menu Shortcuts
SetShellVarContext current
Delete "$DESKTOP\${PRODUCT_VALENTINA}.lnk"
Delete "$DESKTOP\${PRODUCT_TAPE}.lnk"
Delete "${START_LINK_DIR}\*.*"
RmDir "${START_LINK_DIR}"
; Removing file associations
!insertmacro APP_UNASSOCIATE "val" "valentina.pattern"
!insertmacro APP_UNASSOCIATE "vit" "valentina.IndividualMeasurements"
!insertmacro APP_UNASSOCIATE "vst" "valentina.StandardMeasurements"
;Delete Uninstaller And Unistall Registry Entries
DeleteRegKey "${REGISTRY_ROOT}" "SOFTWARE\${PRODUCT_VALENTINA}"
DeleteRegKey "${REGISTRY_ROOT}" "${REG_UNINSTALL}"
Delete "$INSTDIR\${UNINSTALLER_NAME}"
;Remove the installation directory
RMDir "$INSTDIR"
SectionEnd
;eof

View File

@ -436,34 +436,28 @@ win32:*-g++ {
INSTALLS += package_printsupport
contains(QT_ARCH, i386) {
NSIS_MAKENSISW = "C:/Program Files/NSIS/makensisw.exe"
INNO_ISCC = "C:/Program Files (x86)/Inno Setup 5/iscc.exe"
} else {
NSIS_MAKENSISW = "C:/Program Files (x86)/NSIS/makensisw.exe"
INNO_ISCC = "C:/Program Files/Inno Setup 5/iscc.exe"
}
exists($$NSIS_MAKENSISW) {
package_nsis.path = $${OUT_PWD}/../../../package
package_nsis.files += \
$$PWD/../../../dist/win/nsis/valentina.nsi \
$$PWD/../../../dist/win/nsis/unList.exe # copy exe instead of creating from nsi
INSTALLS += package_nsis
package_nsis_headers.path = $${OUT_PWD}/../../../package/headers
package_nsis_headers.files += \
$$PWD/../../../dist/win/nsis/headers/fileassoc.nsh \
$$PWD/../../../dist/win/nsis/headers/fileversion.nsh
INSTALLS += package_nsis_headers
exists($$INNO_ISCC) {
package_inno.path = $${OUT_PWD}/../../../package
package_inno.files += \
$$PWD/../../../dist/win/inno/LICENSE_VALENTINA \
$$PWD/../../../dist/win/inno/valentina.iss
INSTALLS += package_inno
# Do the packaging
# First, mangle all of INSTALLS values. We depend on them.
unset(MANGLED_INSTALLS)
for(x, INSTALLS):MANGLED_INSTALLS += install_$${x}
build_package.path = $${OUT_PWD}/../../../package
build_package.commands = $$NSIS_MAKENSISW \"$${OUT_PWD}/../../../package/valentina.nsi\"
build_package.commands = $$INNO_ISCC \"$${OUT_PWD}/../../../package/valentina.iss\"
build_package.depends = $${MANGLED_INSTALLS}
INSTALLS += build_package
} else {
message("NSIS was not found!")
message("Inno Setup was not found!")
}
}