Skip to content

Commit d314ff0

Browse files
committed
Added Batch that sets environment accordingly.
1 parent 65b96f0 commit d314ff0

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

installer/src/AlgorandNode.wxs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
207207
<Component Id="AlgorandShortcuts" Guid="*">
208208
<Shortcut Id="CommandLineTools" Name="Algorand Command Line Tools"
209209
Target="[System64Folder]cmd.exe"
210-
Arguments="/k cd /d &quot;[netspecificdir]&quot;"
211-
WorkingDirectory="netspecificdir"
210+
Arguments="/k &quot;[netspecificdir]\System\setenv.cmd&quot; /walkback"
211+
WorkingDirectory="systemDir"
212212
Show="normal"/>
213213

214214
<Shortcut Id="NodeStatusWatch" Name="Node Status Watch"
@@ -257,6 +257,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
257257
</RegistryKey>
258258
</Component>
259259

260+
<Component Id='SetEnvBatch' Guid='*'>
261+
<File Id="setenv" Name="setenv.cmd" DiskId="1" Source="$(var.BATCHFOLDER)/setenv.cmd" KeyPath="yes" />
262+
</Component>
263+
260264
</Directory>
261265

262266
<Component Id='BINCOMP_algocfg' Guid='*'>
@@ -425,6 +429,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
425429
<ComponentRef Id='genesisfile' />
426430
<ComponentRef Id='configfile' />
427431
<ComponentRef Id='AlgorandNodeService'/>
432+
<ComponentRef Id='SetEnvBatch'/>
428433
<ComponentRef Id='BINCOMP_algocfg' />
429434
<ComponentRef Id='BINCOMP_algod'/>
430435
<ComponentRef Id='BINCOMP_algoh'/>

installer/src/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ CANDLE=$(WIX)bin/candle.exe
3333
LIGHT=$(WIX)bin/light.exe
3434
GOBINFOLDER=$(HOME)/go/bin
3535
SVCBINFOLDER=../../algodsvc
36+
BATCHFOLDER=./batch
3637
ALGOVERSION := $(shell $(GOBINFOLDER)/goal.exe --version | awk 'FNR == 2 { print $$1 }' | awk -F "." 'BEGIN{OFS=""} { print $$1,".",$$2,".",$$3 }')
3738
MSI=$(MSIDIR)AlgorandNode-$(SUFFIX)_amd64.msi
3839
THISPRODUCTID := $(shell echo -n $(SUFFIX) | sha256sum | cut -c 1-32 | sed 's/./&-/8;s/./&-/13;s/./&-/18;s/./&-/23')
@@ -46,7 +47,7 @@ $(CADLL): $(CASOURCE) $(PCHOUT)
4647
$(CC) $(CASOURCE) -include $(PCHSOURCE) -o $(CADLL) $(CFLAGS)
4748

4849
$(OBJ): $(SOURCES) $(CADLL)
49-
"$(CANDLE)" $(SOURCES) -ext WixUtilExtension -out "$(OBJDIR)" -arch x64 -dTHISPRODUCTID=$(THISPRODUCTID) -dALGOVERSION=$(ALGOVERSION) -dGOBINFOLDER=$(GOBINFOLDER) -dSVCBINFOLDER=$(SVCBINFOLDER) -dNETWORK=$(NETWORK) -v
50+
"$(CANDLE)" $(SOURCES) -ext WixUtilExtension -out "$(OBJDIR)" -arch x64 -dTHISPRODUCTID=$(THISPRODUCTID) -dALGOVERSION=$(ALGOVERSION) -dGOBINFOLDER=$(GOBINFOLDER) -dSVCBINFOLDER=$(SVCBINFOLDER) -dBATCHFOLDER=$(BATCHFOLDER) -dNETWORK=$(NETWORK) -v
5051

5152
$(MSI): $(OBJ)
5253
"$(LIGHT)" $(OBJDIR)*.wixobj -ext WixUtilExtension -ext WixUIExtension -out $(MSI) -reusecab -cc cabs -v

installer/src/batch/setenv.cmd

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
@echo off
2+
echo Algorand Command-line Tools for Windows Environment Setup
3+
echo.
4+
5+
pushd ..
6+
for %%* in (.) do set ALGORAND_NETWORK=%%~nx*
7+
set ALGORAND_TOOLS=%cd%
8+
popd
9+
10+
set ALGORAND_DATA=%PROGRAMDATA%\Algorand\data\%ALGORAND_NETWORK%
11+
set PATH=%PATH%;%ALGORAND_TOOLS%
12+
13+
echo * Set ALGORAND_DATA=%ALGORAND_DATA%
14+
echo * Added "%ALGORAND_TOOLS%" to this session PATH.
15+
16+
echo Done.
17+
18+
if "%1" == "/walkback" cd..

0 commit comments

Comments
 (0)