Skip to content

Commit d9546a9

Browse files
Check for previous installation
1 parent 413a6fb commit d9546a9

File tree

8 files changed

+18
-27
lines changed

8 files changed

+18
-27
lines changed

.gitmodules

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
[submodule "src/tools/convtile"]
2-
path = tools/convtile
3-
url = https://github.com/MattWaltz/convtile
41
[submodule "src/tools/convhex"]
52
path = tools/convhex
63
url = https://github.com/MattWaltz/convhex
@@ -9,4 +6,4 @@
96
url = https://github.com/MattWaltz/convpng
107
[submodule "tools/spasm-ng"]
118
path = tools/spasm-ng
12-
url = https://github.com/jacobly0/spasm-ng
9+
url = https://github.com/MattWaltz/spasm-ng.git

installer/EnvVarUpdate.nsh

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
*
2525
* http://nsis.sourceforge.net/Environmental_Variables:_append%2C_prepend%2C_and_remove_entries
2626
*
27+
* Modified for CE C toolchain (Doesn't require uninstall support)
2728
*/
2829

2930

@@ -32,18 +33,14 @@
3233
!verbose push
3334
!verbose 3
3435
!include "LogicLib.nsh"
35-
!include "WinMessages.NSH"
36+
!include "WinMessages.nsh"
3637
!include "StrFunc.nsh"
3738

3839
; ---- Fix for conflict if StrFunc.nsh is already includes in main file -----------------------
3940
!macro _IncludeStrFunction StrFuncName
4041
!ifndef ${StrFuncName}_INCLUDED
4142
${${StrFuncName}}
4243
!endif
43-
!ifndef Un${StrFuncName}_INCLUDED
44-
${Un${StrFuncName}}
45-
!endif
46-
!define un.${StrFuncName} "${Un${StrFuncName}}"
4744
!macroend
4845

4946
!insertmacro _IncludeStrFunction StrTok
@@ -60,16 +57,6 @@
6057
Pop "${ResultVar}"
6158
!macroend
6259
!define EnvVarUpdate '!insertmacro "_EnvVarUpdateConstructor"'
63-
64-
!macro _unEnvVarUpdateConstructor ResultVar EnvVarName Action Regloc PathString
65-
Push "${EnvVarName}"
66-
Push "${Action}"
67-
Push "${RegLoc}"
68-
Push "${PathString}"
69-
Call un.EnvVarUpdate
70-
Pop "${ResultVar}"
71-
!macroend
72-
!define un.EnvVarUpdate '!insertmacro "_unEnvVarUpdateConstructor"'
7360
; ---------------------------------- Macro Definitions end-------------------------------------
7461

7562
;----------------------------------- EnvVarUpdate start----------------------------------------
@@ -320,7 +307,6 @@ FunctionEnd
320307

321308
!macroend ; EnvVarUpdate UN
322309
!insertmacro EnvVarUpdate ""
323-
!insertmacro EnvVarUpdate "un."
324310
;----------------------------------- EnvVarUpdate end----------------------------------------
325311

326312
!verbose pop

installer/installer.nsi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ Section ""
5151
;Add installed folder (DIST_PATH is set from the makefile)
5252
File /r ${DIST_PATH}\*.*
5353

54+
;Check for old path
55+
ReadRegStr $R1 ${env_hkcu} "CEDEV"
56+
${EnvVarUpdate} $0 "PATH" "R" "HKLM" "$R1\bin"
57+
5458
;Add to PATH
5559
${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$INSTDIR\bin"
5660

makefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,18 @@ RELEASE_NAME := CEdev
88
ifeq ($(OS),Windows_NT)
99
NATIVEPATH = $(subst /,\,$(1))
1010
WINPATH = $(NATIVEPATH)
11+
WINCHKDIR = if exist $(1)
1112
RM = del /f 2>nul
1213
RMDIR = rmdir /s /q
1314
MKDIR = mkdir
1415
PREFIX ?= C:
1516
INSTALLLOC := $(call NATIVEPATH,$(DESTDIR)$(PREFIX))
1617
CP = copy /y
18+
SPASMFLG = MINGW_COMPILE=YES
1719
EXMPL_DIR = $(call NATIVEPATH,$(INSTALLLOC)/CEdev/examples)
1820
CP_EXMPLS = (if not exist "$(EXMPL_DIR)" mkdir $(EXMPL_DIR)) && xcopy /y /s /e $(call NATIVEPATH,$(CURDIR)/examples) $(EXMPL_DIR)
1921
ARCH = makensis.exe /DDIST_PATH=$(call NATIVEPATH,$(DESTDIR)$(PREFIX)/CEdev) $(call NATIVEPATH,$(CURDIR)\installer\installer.nsi) && \
20-
(if not exist "..\release" mkdir "..\release") && move /y installer\CEdev.exe release
22+
(if not exist "release" mkdir "release") && move /y installer\CEdev.exe release\\
2123
else
2224
NATIVEPATH = $(subst \,/,$(1))
2325
WINPATH = $(shell winepath --windows $(1))
@@ -72,12 +74,15 @@ all: $(SPASM) $(CONVHEX) $(CONVPNG) graphx fileioc keypadc ce std
7274
# tool rules
7375
#----------------------------
7476
$(SPASM) $(CONVHEX) $(CONVPNG):
75-
$(MAKE) -C $(dir $@)
77+
$(MAKE) -C $(SPASMDIR) $(SPASMFLG)
78+
$(MAKE) -C $(CONVHEXDIR)
79+
$(MAKE) -C $(CONVPNGDIR)
7680

7781
clean: clean-graphx clean-fileioc clean-keypadc clean-ce clean-std
7882
$(MAKE) -C $(SPASMDIR) clean
7983
$(MAKE) -C $(CONVHEXDIR) clean
8084
$(MAKE) -C $(CONVPNGDIR) clean
85+
$(WINCHKDIR) $(RMDIR) release
8186
#----------------------------
8287

8388
#----------------------------
@@ -127,7 +132,7 @@ clean-keypadc:
127132
#----------------------------
128133

129134
uninstall:
130-
$(RMDIR) $(call NATIVEPATH,$(INSTALLLOC)/CEdev)
135+
$(WINCHKDIR) $(RMDIR) $(call NATIVEPATH,$(INSTALLLOC)/CEdev)
131136

132137
install: $(DIRS)
133138
$(CP_EXMPLS)

tools/convhex

tools/convpng

tools/convtile

Lines changed: 0 additions & 1 deletion
This file was deleted.

tools/spasm-ng

0 commit comments

Comments
 (0)