Skip to content

Commit

Permalink
Merge pull request #35 from safing/feature/remove-dnscache-changes
Browse files Browse the repository at this point in the history
Remove starting and stopping the Windows DNS Client
  • Loading branch information
dhaavi authored Mar 23, 2021
2 parents 497094c + 3d7c364 commit 0b672c4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 25 deletions.
12 changes: 7 additions & 5 deletions windows/Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# Note: Built for execution in container .github/actions/build-nsis

STARTURL ?= https://updates.safing.io/latest/windows_amd64/start/portmaster-start.exe\?client=Github
STARTURL ?= https://updates.safing.io/latest/windows_amd64/start/portmaster-start.exe

all: portmaster-uninstaller.exe portmaster-installer.exe

wine-setup:
which sudo && sudo chown -R $$(id -u):$$(id -g) $(WINEPREFIX) || true

portmaster-start.exe:
curl --fail --user-agent GitHub -o portmaster-start.exe $(STARTURL)

portmaster-uninstaller.exe: portmaster-installer.nsi install_summary.nsh
echo hi
portmaster-uninstaller.exe: wine-setup portmaster-installer.nsi install_summary.nsh
makensis -DUNINSTALLER portmaster-installer.nsi
WINEPREFIX=/tmp wine ./uninstaller_pkg.exe
wine ./uninstaller_pkg.exe
ifdef SIGN
@echo -e "If wanted, sign now (on Windows) using:\nsign.bat portmaster-uninstaller.exe\npress enter to continue"
@read x
Expand All @@ -21,7 +23,7 @@ install_summary.nsh: install_summary.rtf
perl -p -e 's/\r?\n/\$$\\r\$$\\n/' install_summary.rtf >> install_summary.nsh
echo '"' >> install_summary.nsh

portmaster-installer.exe: portmaster-start.exe portmaster-installer.nsi portmaster-uninstaller.exe install_summary.nsh
portmaster-installer.exe: wine-setup portmaster-start.exe portmaster-installer.nsi portmaster-uninstaller.exe install_summary.nsh
makensis -DINSTALLER -DPRODUCTION portmaster-installer.nsi #Production enables good compression (takes longer)
ifdef SIGN
@echo -e "If wanted, sign now (on Windows) using:\nsign.bat portmaster-installer.exe\npress enter to continue"
Expand Down
4 changes: 1 addition & 3 deletions windows/install_summary.rtf
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
\f1\b0\fs18 \
\f0\b Portmaster updates itself automatically. Learn more about this on docs.safing.io.\
\
\cf0 Installing Portmaster will deactivate the system's DNS Cache Service (Portmaster brings its own). This may break/impair Edge and possibly other Microsoft products.\
\
\f0\fs30 Details
\f1\b0\fs18 \
\
Install Location, settings, profiles and other data\
Install location, settings, profiles and other data\
C:\\ProgramData\\Safing\\Portmaster\
\
Symlink at\
Expand All @@ -27,5 +26,4 @@ Service\
Registry\
HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Portmaster\
HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\CLSID\\\{7F00FB48-65D5-4BA8-A35B-F194DA7E1A51\}\\LocalServer32\
HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\services\\Dnscache: Start=4\
}
24 changes: 7 additions & 17 deletions windows/portmaster-installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,8 @@ dontUpdate:
${EndIf}

;Actually gets placed at HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Portmaster because NSIS is 32 Bit
;WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Portmaster" \
; "InstallDate" "" ; TODO
;WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Portmaster" \
; "EstimatedSize" 1
;WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Portmaster" \
; "DisplayVersion" 1 ;
;WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Portmaster" \
; "InstallDate" "" ; TODO
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Portmaster" \
"DisplayName" "Portmaster"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Portmaster" \
Expand All @@ -186,11 +182,11 @@ dontUpdate:
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Portmaster" \
"NoModify" 1

${If} ${IsWin10}
SetRegView 64
WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\services\Dnscache" "Start" 4
SetRebootFlag true
${EndIf}
; Start Portmaster Core Service and Notifier
DetailPrint "Starting Portmaster Core Service and Notifier ..."
Exec '"sc.exe" start PortmasterCore'
Exec '"$INSTDIR\${ExeName}" notifier --data=$InstDir'

SectionEnd
!endif

Expand Down Expand Up @@ -218,12 +214,6 @@ Section Un.Portmaster SectionPortmaster

DeleteRegKey HKLM "SOFTWARE\Classes\CLSID\{7F00FB48-65D5-4BA8-A35B-F194DA7E1A51}\LocalServer32"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Portmaster"

${If} ${IsWin10}
SetRegView 64
WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\services\Dnscache" "Start" 2 ; start DNSCache again (on reboot)
SetRebootFlag true
${EndIf}

Delete "${ProgrammFolderLink}"
RMDir "${Parent_ProgrammFolderLink}"
Expand Down

0 comments on commit 0b672c4

Please sign in to comment.