Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nullsoft Installer script for Win32 #54

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!define Version "1.15"
2 changes: 1 addition & 1 deletion decoderlibav.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ KeyFinder::AudioData* LibAvDecoder::decodeFile(const QString& filePath){
throw KeyFinder::Exception(ss.str());
}

if(av_find_stream_info(fCtx) < 0){
if(avformat_find_stream_info(fCtx,NULL) < 0){
throw KeyFinder::Exception("Could not find stream information");
}
int audioStream = -1;
Expand Down
3 changes: 2 additions & 1 deletion guibatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ void BatchWindow::addDroppedFiles(){

// check for symlink (.isSymLink doesn't seem to work on Lion)
if(fileInfo.isSymLink() || fileInfo.symLinkTarget() != ""){
droppedFiles.push_back(QUrl(fileInfo.symLinkTarget()));
droppedFiles.push_back(QUrl::fromLocalFile(fileInfo.symLinkTarget()));
continue;
}

Expand Down Expand Up @@ -637,6 +637,7 @@ void BatchWindow::deleteSelectedRows(){
}
}
setGuiDefaults();
this->setWindowTitle("KeyFinder - Batch Analysis - " + QString::number(ui->tableWidget->rowCount()) + " files");
}

void BatchWindow::copySelectedFromTableWidget(){
Expand Down
116 changes: 116 additions & 0 deletions keyfinder.nsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
!include "Version.txt"

; keyfinder.nsi
;
; This script installs KeyFinder in Program Files, remembers the directory,
; has uninstall support and (optionally) installs start menu & desktop shortcuts.
;

;--------------------------------

; The name of the installer
Name "KeyFinder ${VERSION}"

; The file to write
OutFile "KeyFinder-${VERSION}.exe"

; The default installation directory
InstallDir $PROGRAMFILES\KeyFinder

; Registry key to check for directory (so if you install again, it will
; overwrite the old one automatically)
InstallDirRegKey HKLM "Software\KeyFinder" "Install_Dir"

; Request application privileges for Windows Vista
RequestExecutionLevel admin

;--------------------------------

; Pages

Page components
Page directory
Page instfiles

UninstPage uninstConfirm
UninstPage instfiles

;--------------------------------

; The stuff to install
Section "KeyFinder (required)"

SectionIn RO

; Set output path to the installation directory.
SetOutPath $INSTDIR

; Put file there
File "avcodec-53.dll"
File "avformat-53.dll"
File "avutil-51.dll"
File "COPYING.txt"
File "KeyFinder.exe"
File "keyfinder0.dll"
File "libfftw3-3.dll"
File "libgcc_s_dw2-1.dll"
File "libsamplerate-0.dll"
File "libtag.dll"
File "mingwm10.dll"
File "QtCore4.dll"
File "QtGui4.dll"
File "QtNetwork4.dll"
File "QtXmlPatterns4.dll"
File "vcredist_x86.exe"

ExecWait '"$INSTDIR\vcredist_x86" /passive /norestart'

; Write the installation path into the registry
WriteRegStr HKLM SOFTWARE\KeyFinder "Install_Dir" "$INSTDIR"

; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\KeyFinder" "DisplayName" "KeyFinder"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\KeyFinder" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\KeyFinder" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\KeyFinder" "NoRepair" 1
WriteUninstaller "uninstall.exe"

SectionEnd

; Optional section (can be disabled by the user)
Section "Start Menu Shortcuts"

CreateDirectory "$SMPROGRAMS\KeyFinder"
CreateShortCut "$SMPROGRAMS\KeyFinder\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
CreateShortCut "$SMPROGRAMS\KeyFinder\KeyFinder.lnk" "$INSTDIR\KeyFinder.exe" "" "$INSTDIR\KeyFinder.exe" 0

SectionEnd

; Optional section (can be disabled by the user)
Section "Desktop Shortcut"

CreateShortCut "$DESKTOP\KeyFinder.lnk" "$INSTDIR\KeyFinder.exe" "" "$INSTDIR\KeyFinder.exe" 0

SectionEnd
;--------------------------------

; Uninstaller

Section "Uninstall"

; Remove registry keys
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\KeyFinder"
DeleteRegKey HKLM SOFTWARE\KeyFinder

; Remove files and uninstaller
Delete $INSTDIR\KeyFinder.exe
Delete $INSTDIR\uninstall.exe

; Remove shortcuts, if any
Delete "$SMPROGRAMS\KeyFinder\*.*"

; Remove directories used
RMDir "$SMPROGRAMS\KeyFinder"
RMDir "$INSTDIR"

SectionEnd
2 changes: 1 addition & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ int main(int argc, char* argv[]){
QCoreApplication::setApplicationName("KeyFinder");

// libav setup
avcodec_init(); // is disraeli necessary?
// avcodec_init(); // is disraeli necessary?
av_register_all();
av_log_set_level(AV_LOG_ERROR);

Expand Down