Added win32 installer project.

This commit is contained in:
crs 2004-03-28 20:00:00 +00:00
parent cfb082f306
commit 2963372089
8 changed files with 444 additions and 0 deletions

1
dist/Makefile.am vendored
View File

@ -17,6 +17,7 @@ VDEPTH = ./$(VPATH)/$(DEPTH)
SUBDIRS = \
rpm \
nullsoft \
$(NULL)
EXTRA_DIST = \

27
dist/nullsoft/Makefile.am vendored Normal file
View File

@ -0,0 +1,27 @@
# synergy -- mouse and keyboard sharing utility
# Copyright (C) 2002 Chris Schoeneman
#
# This package is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# found in the file COPYING that should have accompanied this file.
#
# This package 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.
## Process this file with automake to produce Makefile.in
NULL =
DEPTH = ../..
VDEPTH = ./$(VPATH)/$(DEPTH)
EXTRA_DIST = \
installer.dsp \
installer.mak \
synergy.nsi \
dosify.c \
$(NULL)
MAINTAINERCLEANFILES = \
Makefile.in \
$(NULL)

99
dist/nullsoft/dosify.c vendored Normal file
View File

@ -0,0 +1,99 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static
char*
concatPath(const char* dir, const char* name, const char* ext)
{
size_t nDir = (dir != NULL) ? strlen(dir) : 0;
size_t nPath = nDir + 1 + strlen(name) + strlen(ext?ext:"") + 1;
char* path = malloc(nPath);
/* directory */
if (nDir > 0 && strcmp(dir, ".") != 0) {
strcpy(path, dir);
if (path[nDir - 1] != '\\' && path[nDir - 1] != '/') {
strcat(path, "\\");
}
}
else {
strcpy(path, "");
}
/* name */
strcat(path, name);
/* extension */
if (ext != NULL && strrchr(name, '.') == NULL) {
strcat(path, ext);
}
return path;
}
static
int
dosify(const char* srcdir, const char* dstdir, const char* name)
{
FILE* dFile, *sFile;
char* dName, *sName;
sName = concatPath(srcdir, name, NULL);
dName = concatPath(dstdir, name, ".txt");
sFile = fopen(sName, "rb");
if (sFile == NULL) {
fprintf(stderr, "Can't open \"%s\" for reading\n", sName);
return 0;
}
else {
dFile = fopen(dName, "w");
if (dFile == NULL) {
fclose(sFile);
fprintf(stderr, "Can't open \"%s\" for writing\n", dName);
return 0;
}
else {
char buffer[1024];
while (!ferror(dFile) &&
fgets(buffer, sizeof(buffer), sFile) != NULL) {
fprintf(dFile, "%s", buffer);
}
if (ferror(sFile) || ferror(dFile)) {
fprintf(stderr,
"Error copying \"%s\" to \"%s\"\n", sName, dName);
fclose(dFile);
fclose(sFile);
_unlink(dName);
return 0;
}
}
}
fclose(dFile);
fclose(sFile);
free(dName);
free(sName);
return 1;
}
#include <windows.h>
int
main(int argc, char** argv)
{
int i;
if (argc < 3) {
fprintf(stderr, "usage: %s <srcdir> <dstdir> [files]\n", argv[0]);
return 1;
}
for (i = 3; i < argc; ++i) {
if (!dosify(argv[1], argv[2], argv[i]))
return 1;
}
return 0;
}

124
dist/nullsoft/installer.dsp vendored Normal file
View File

@ -0,0 +1,124 @@
# Microsoft Developer Studio Project File - Name="installer" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) External Target" 0x0106
CFG=installer - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "installer.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "installer.mak" CFG="installer - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "installer - Win32 Release" (based on "Win32 (x86) External Target")
!MESSAGE "installer - Win32 Debug" (based on "Win32 (x86) External Target")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
!IF "$(CFG)" == "installer - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "installer___Win32_Release"
# PROP BASE Intermediate_Dir "installer___Win32_Release"
# PROP BASE Cmd_Line "NMAKE /f installer.mak"
# PROP BASE Rebuild_Opt "/a"
# PROP BASE Target_File "installer.exe"
# PROP BASE Bsc_Name "installer.bsc"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "."
# PROP Intermediate_Dir "."
# PROP Cmd_Line "nmake /nologo /f "installer.mak""
# PROP Rebuild_Opt "/a"
# PROP Target_File "..\..\SynergyInstaller.exe"
# PROP Bsc_Name ""
# PROP Target_Dir ""
NSIS=makensis
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "installer___Win32_Debug"
# PROP BASE Intermediate_Dir "installer___Win32_Debug"
# PROP BASE Cmd_Line "NMAKE /f installer.mak"
# PROP BASE Rebuild_Opt "/a"
# PROP BASE Target_File "installer.exe"
# PROP BASE Bsc_Name "installer.bsc"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "."
# PROP Intermediate_Dir "."
# PROP Cmd_Line "echo "Can only build installer for Release configuration""
# PROP Rebuild_Opt ""
# PROP Target_File "dummy.exe"
# PROP Bsc_Name ""
# PROP Target_Dir ""
NSIS=makensis
!ENDIF
# Begin Target
# Name "installer - Win32 Release"
# Name "installer - Win32 Debug"
!IF "$(CFG)" == "installer - Win32 Release"
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
!ENDIF
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\dosify.c
# PROP Intermediate_Dir "."
# End Source File
# Begin Source File
SOURCE=.\installer.mak
!IF "$(CFG)" == "installer - Win32 Release"
# PROP Intermediate_Dir "."
!ELSEIF "$(CFG)" == "installer - Win32 Debug"
# PROP Intermediate_Dir "."
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\synergy.nsi
# PROP Intermediate_Dir "."
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

28
dist/nullsoft/installer.mak vendored Executable file
View File

@ -0,0 +1,28 @@
NULL=
DEPTH=..\..
NSIS="D:\Program Files\NSIS\makensis"
DOCS = \
AUTHORS \
BUGS \
COPYING \
ChangeLog \
FAQ \
HISTORY \
INSTALL \
NEWS \
README \
TODO \
$(NULL)
default: dosifydocs installer
installer:
$(NSIS) synergy.nsi
dosifydocs: dosify.exe
.\dosify.exe $(DEPTH) . $(DOCS)
dosify.exe: dosify.c
$(CC) /nologo /Yd /Zi /MLd /Fe$@ $**

152
dist/nullsoft/synergy.nsi vendored Normal file
View File

@ -0,0 +1,152 @@
; Synergy.nsi
;
; This script is based on example1.nsi, but it remember the directory,
; has uninstall support and (optionally) installs start menu shortcuts.
;
; It will install makensisw.exe into a directory that the user selects,
;--------------------------------
; Path to root of tree
!define DEPTH "..\.."
; The name of the installer
Name "Synergy"
; The file to write
OutFile "${DEPTH}/SynergyInstaller.exe"
; The default installation directory
InstallDir $PROGRAMFILES\Synergy
; Registry key to check for directory (so if you install again, it will
; overwrite the old one automatically)
InstallDirRegKey HKLM "Software\Synergy" "Install_Dir"
;--------------------------------
; Pages
Page license
Page components
Page directory
Page instfiles
UninstPage uninstConfirm
UninstPage instfiles
;--------------------------------
; Text
ComponentText "This this install Synergy on your computer. Select the optional components you want to install."
DirText "Choose a directory to install Synergy to:"
UninstallText "This will uninstall Synergy from your computer."
LicenseText "Synergy is distributed under the GNU GPL:"
LicenseData "COPYING.txt"
;--------------------------------
; The stuff to install
Section "Synergy (required)"
SectionIn RO
; Set output path to the installation directory.
SetOutPath $INSTDIR
; Put files there
File "${DEPTH}\Release\synergy.exe"
File "${DEPTH}\Release\synergyc.exe"
File "${DEPTH}\Release\synergys.exe"
File "${DEPTH}\Release\*.dll"
File AUTHORS.txt
File BUGS.txt
File COPYING.txt
File ChangeLog.txt
File FAQ.txt
File HISTORY.txt
File INSTALL.txt
File NEWS.txt
File README.txt
File TODO.txt
; Write the installation path into the registry
WriteRegStr HKLM SOFTWARE\Synergy "Install_Dir" "$INSTDIR"
; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Synergy" "DisplayName" "Synergy"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Synergy" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Synergy" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Synergy" "NoRepair" 1
WriteUninstaller "uninstall.exe"
SectionEnd
; Optional section (can be disabled by the user)
Section "Start Menu Shortcuts"
CreateDirectory "$SMPROGRAMS\Synergy"
CreateShortCut "$SMPROGRAMS\Synergy\Synergy.lnk" "$INSTDIR\synergy.exe" "" "$INSTDIR\synergy.exe" 0
CreateShortCut "$SMPROGRAMS\Synergy\README.lnk" "$INSTDIR\README.txt"
CreateShortCut "$SMPROGRAMS\Synergy\NEWS.lnk" "$INSTDIR\NEWS.txt"
CreateShortCut "$SMPROGRAMS\Synergy\FAQ.lnk" "$INSTDIR\FAQ.txt"
CreateShortCut "$SMPROGRAMS\Synergy\Synergy Folder.lnk" "$INSTDIR"
CreateShortCut "$SMPROGRAMS\Synergy\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
SectionEnd
;--------------------------------
; Uninstaller
Section "Uninstall"
; Remove autorun registry keys for synergy
DeleteRegKey HKLM "SYSTEM\CurrentControlSet\Services\Synergy Server"
DeleteRegKey HKLM "SYSTEM\CurrentControlSet\Services\Synergy Client"
DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\RunServices" "Synergy Server"
DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\RunServices" "Synergy Client"
DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "Synergy Server"
DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "Synergy Client"
; not all keys will have existed, so errors WILL have happened
ClearErrors
; Remove registry keys
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Synergy"
DeleteRegKey HKLM SOFTWARE\Synergy
ClearErrors
; First try to remove files that might be locked (if synergy is running)
Delete /REBOOTOK $INSTDIR\synergy.exe
Delete /REBOOTOK $INSTDIR\synergyc.exe
Delete /REBOOTOK $INSTDIR\synergys.exe
Delete /REBOOTOK $INSTDIR\synrgyhk.dll
; Remove files and directory
Delete $INSTDIR\*.*
RMDir $INSTDIR
; Remove shortcuts, if any
Delete "$SMPROGRAMS\Synergy\*.*"
; Remove directories used
RMDir "$SMPROGRAMS\Synergy"
RMDir "$INSTDIR"
IfRebootFlag 0 EndOfAll
MessageBox MB_OKCANCEL "Uninstaller needs to reboot to finish cleaning up. reboot now?" IDCANCEL NoReboot
ClearErrors
Reboot
IfErrors 0 EndOfAll
MessageBox MB_OK "Uninstaller could not reboot. Please reboot manually. Thank you."
Abort "Uninstaller could not reboot. Please reboot manually. Thank you."
NoReboot:
DetailPrint ""
DetailPrint "Uninstaller could not reboot. Please reboot manually. Thank you."
DetailPrint ""
SetDetailsView show
EndOfAll:
SectionEnd

View File

@ -16,6 +16,7 @@ DEPTH = ../..
VDEPTH = ./$(VPATH)/$(DEPTH)
EXTRA_DIST = \
synergy.spec.in \
$(NULL)
MAINTAINERCLEANFILES = \

View File

@ -84,6 +84,18 @@ Package=<4>
###############################################################################
Project: "installer"=".\DIST\NULLSOFT\installer.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "io"=".\lib\io\io.dsp" - Package Owner=<4>
Package=<5>